Højreklik i billedepopup.js
Jeg vil gerne gøre sådan at der i min billede-popup bliver "no-right-click".Altså skal denne kode sættes ind:
<script type="text/javascript">
function cutBubble()
{
if(event.srcElement.tagName=='IMG')
{
window.event.returnValue=false
}
}
</script>
samt <body oncontextmenu="cutBubble()" onselectstart="cutBubble()">
Billedepopup.js:
var nextclose = 0
function popup(filNavn) {
imageWin=window.open("", "imageWin", filNavn, "width=100,height=100");
imageWin.document.open();
imageWin.document.write(
'<html>'+
'<head>'+
'<title>ImageViewer</title>'+
'<meta http-equiv="imagetoolbar" content="no">'+
'<\script language="JavaScript">'+
'self.focus();'+
'function myResize() {'+
'picW = document.images["pic"].width;'+
'picH = document.images["pic"].height;'+
'picW = picW+10;'+
'picH = picH+37;'+
'if(picW > screen.availWidth)'+
'{'+
'picW = screen.availWidth'+
'}'+
'if(picH > screen.availHeight)'+
'{'+
'picH = screen.availHeight'+
'}'+
'window.resizeTo(picW,picH);'+
'}'+
'<\/script>'+
'</head>'+
'<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" bottommargin="0" marginheight="0" oncontextmenu="cutBubble()" onselectstart="cutBubble()" onload="myResize();">'+
'<DIV STYLE="width: 100%; height: 100%; overflow: auto;">'+
'<center><font face="Verdana" size="2">' + filNavn + '</font></center>'+
'<img src="' + filNavn + '" NAME="pic" onclick="window.close()">'+
'</DIV>'+
'</body>'+
'</html>' );
imageWin.document.close();
}
