Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Right Click Menu

    How to add options on right clicking on a Browser window?
    Can do add to existing options on right click.?
    Or a new popup can be opened?

  • #2
    New Coder
    Join Date
    Aug 2008
    Posts
    60
    Thanks
    6
    Thanked 6 Times in 6 Posts
    Try This...
    Code:
    <style>
    <!--
    .skin0 {
    position:absolute;
    text-align:left;
    width:200px;
    border:2px solid black;
    background-color:menu;
    font-family:Verdana;
    line-height:20px;
    cursor:default;
    visibility:hidden;
    }
    .skin1 {
    cursor:default;
    font:menutext;
    position:absolute;
    text-align:left;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10pt;
    width:120px;
    background-color:menu;
    border:1 solid buttonface;
    visibility:hidden;
    border:2 outset buttonhighlight;
    }
    .menuitems {
    padding-left:15px;
    padding-right:10px;
    }
    -->
    </STYLE>
    
    <script LANGUAGE="JavaScript1.2">
    <!-- Begin
    var menuskin = "skin1"; // skin0, or skin1
    var display_url = 0; // Show URLs in status bar?
    function showmenuie5() {
    var rightedge = document.body.clientWidth-event.clientX;
    var bottomedge = document.body.clientHeight-event.clientY;
    if (rightedge < ie5menu.offsetWidth)
    ie5menu.style.left = document.body.scrollLeft + event.clientX - ie5menu.offsetWidth;
    else
    ie5menu.style.left = document.body.scrollLeft + event.clientX;
    if (bottomedge < ie5menu.offsetHeight)
    ie5menu.style.top = document.body.scrollTop + event.clientY - ie5menu.offsetHeight;
    else
    ie5menu.style.top = document.body.scrollTop + event.clientY;
    ie5menu.style.visibility = "visible";
    return false;
    }
    function hidemenuie5() {
    ie5menu.style.visibility = "hidden";
    }
    function highlightie5() {
    if (event.srcElement.className == "menuitems") {
    event.srcElement.style.backgroundColor = "highlight";
    event.srcElement.style.color = "white";
    if (display_url)
    window.status = event.srcElement.url;
       }
    }
    function lowlightie5() {
    if (event.srcElement.className == "menuitems") {
    event.srcElement.style.backgroundColor = "";
    event.srcElement.style.color = "black";
    window.status = "";
       }
    }
    function jumptoie5() {
    if (event.srcElement.className == "menuitems") {
    if (event.srcElement.getAttribute("target") != null)
    window.open(event.srcElement.url, event.srcElement.getAttribute("target"));
    else
    window.location = event.srcElement.url;
       }
    }
    //  End -->
    </script>
    
    
    
    
    <BODY>
    
    <div id="ie5menu" class="skin0" onMouseover="highlightie5()" onMouseout="lowlightie5()" onClick="jumptoie5();">
    <div class="menuitems" url="url">YOURTEXT</div>
    <div class="menuitems" url="url">YOURTEXT</div>
    <hr>
    <div class="menuitems" url="url">YOURTEXT</div>
    <div class="menuitems" url="url">YOURTEXT</div>
    <hr>
    <div class="menuitems" url="url">YOURTEXT</div>
    <div class="menuitems" url="url">YOURTEXT</div>
    <div class="menuitems" url="url">YOURTEXT</div>
    </div>
    </BODY></SCRIPT><script language="JavaScript1.2">
    if (document.all && window.print) {
    ie5menu.className = menuskin;
    document.oncontextmenu = showmenuie5;
    document.body.onclick = hidemenuie5;
    }
    </script>
    This Only Works In IE

  • #3
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thnks buddy....actually i got this from sum where already...but it working in IE only...
    And also my priority is to add in existing right click menu....if possible...

  • #4
    New Coder
    Join Date
    Aug 2008
    Posts
    60
    Thanks
    6
    Thanked 6 Times in 6 Posts
    I don't think there is but you could do what i did and use that plus something like this...
    Code:
    <![if !IE]>
    <div class="bordertrue" onMouseOver="scroll.stop();" onMouseOut="scroll.start();">
    <marquee id="scroll" direction="down" height="200px">
    <A href="URL">YOURTEXT</A><br>
    <a href="URL">YOURTEXT</a><br>
    <a href="URL">YOURTEXT</a><br>
    <a href="URL">YOURTEXT</a><br>
    <a href="URL">YOURTEXT</a>
    </marquee></div><style>.bordertrue{border: Grey 2px solid;}a:link{color: blue;}a:hover{color: red; font-size: 20px;}a:visited{color: black;}a:active{color: black;}</style><![endif]>
    That only displays in non-IE browsers.

  • #5
    Regular Coder ohgod's Avatar
    Join Date
    Jun 2008
    Location
    Ohio
    Posts
    579
    Thanks
    6
    Thanked 69 Times in 69 Posts
    Code:
    <body oncontextmenu="functionthatmakesapopup(); return false;">

    then you just have to get some sort of popup rigged. i use it in ff and ie just fine.
    Last edited by ohgod; 08-20-2008 at 06:09 PM.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •