PDA

View Full Version : Conflict with No Right click + Status Bar?


CloudF7
08-17-2002, 06:03 AM
Hello,

Im using two different script on the same page, one is a no right click javascript and one is a status bar script that just makes it blank

No Right Click Script-

<script language=JavaScript>
function clickIE() {
if (document.all) {
return false;
}
}
function clickNS(e) {
if (document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS;
}
else{
document.onmouseup=clickNS;
document.oncontextmenu=clickIE;
}
document.oncontextmenu=new Function("return false")
</script>


Status Bar Script -

<script>
function hidestatus(){
window.status=''
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus
</script>

Well i tested the page and after about 2 mins i found a bug about how if i right clicked my links with my mouse it shows the link which makes having the script in place useless, is there a conflict between these two scripts? and is there a way to fix it so when i right click on the link on my page that it wont display the link?

Any help would be appreciated, im not good at programming java/javascript since im a noob at it and i just started to try to learn it about 4 days ago.

Sorry about posting the whole script of each but i thought it might help :(

Thank you,

Cloud

Mr J
08-17-2002, 10:56 AM
To start with in the Statusbar script you have


document.onmouseover=hidestatus
document.onmouseout=hidestatus


which will hide the statusbar when the mouse is over the document and when the mouse is not

So it will never show

Mr J
08-17-2002, 11:01 AM
Ignore my last post I see now what your trying to do.

t3cat5
08-18-2002, 02:18 PM
Just a note about no right click code. Works fine on peecee but, if your visitor is using a Mac the no right click javascripts I have tryed all don't work including the one you have. plus there is always a way to get the source code of a site including the code in external js files.