Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netscapte 6 compatibility issue

Status
Not open for further replies.

ashishjain

Programmer
Feb 20, 2002
32
IN
Hi all,
we can trap mouse right click using below written code:

<HTML>
<BODY>

<img border=&quot;0&quot; src=&quot;quantum.gif&quot; width=&quot;240&quot; height=&quot;125&quot;>
<img border=&quot;0&quot; src=&quot;quantum.gif&quot; width=&quot;240&quot; height=&quot;125&quot;>

<SELECT id=&quot;select1&quot; name=select1>
<OPTION selected>Option1</OPTION>
</SELECT>


<script language=&quot;JavaScript1.2&quot;>

var clickmessage=&quot;Right click disabled on images!&quot;

function disableclick(e)
{
if (document.all)
{
if (event.button==2||event.button==3)
{
if (event.srcElement.tagName ==&quot;SELECT&quot;)
{
alert(clickmessage + &quot;: IE &quot;);
return false;
}
}
}
else if (document.layers)
{
if (e.which == 3)
{
alert(clickmessage + &quot;: NetScape &quot;);
return false;
}
}
else if (document.getElementById)
{
if (e.which==3 && e.target.tagName== &quot;SELECT&quot;)
{

alert(clickmessage + &quot;: NetScape611 &quot;);
//divTag = document.getElementById(&quot;select1&quot;);
//document.removeEventListener(&quot;mouseup&quot;,disableclick,false)

return false;
}
}

}

function associateimages()
{

for(i=0;i< document.images.length;i++)
document.images.onmousedown=disableclick;
}

if (document.all)
{
document.onmousedown=disableclick
}
else if (document.getElementById)
//divTag = document.getElementById(&quot;select1&quot;);
//divTag.addEventListener(&quot;mousedown&quot;,disableclick,false);

document.onmousedown=disableclick;
else if (document.layers)
{
associateimages()
}

</script>

</BODY>
</HTML>


This code works fine in IE & NS 4.7 but it doesn't work in NS6. actully i want to disable popup menu which comes when we right clieck on the document in NS6.

Please help me out.

Thanx in advance

Ashish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top