Forum de discussion
Forum « Programmation Javascript » (archives)
Re: exécuter javascript depuis page parent sur popup image enfant [reposté]
Envoyé: 17 février 2005, 13h38 par kireip
voici donc le nouveau script (ça peut toujours servir) :
// --> source OUVRIR IMAGE dans POPUP (Fever! openPictureWindow)
function openPictureWindow_Fever(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
newWindow.document.open();
newWindow.document.write('<html><head><title>'+alt+'</title>');
// --> source DESACTIVE CLIC DROIT
newWindow.document.write('<script language="JavaScript" type="text/JavaScript">');
newWindow.document.write('var message="";');
newWindow.document.write('function clickIE() {if (document.all) {(message);return false;}}');
newWindow.document.write('function clickNS(e) {if(document.layers||(document.getElementById&&!document.all)) {if (e.which==2||e.which==3) {(message);return false;}}}');
newWindow.document.write('if (document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}');
newWindow.document.write('document.oncontextmenu=new Function("return false")');
newWindow.document.write('</');
newWindow.document.write('script>');
newWindow.document.write('<head>');
// --> source OUVRIR IMAGE dans POPUP (Fever! openPictureWindow) [suite]
newWindow.document.write('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">');
if (imageType == "swf"){
newWindow.document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
newWindow.document.write('<param name=movie value=\"'+imageName+'\"><param name=quality value=high>');
newWindow.document.write('<embed src=\"'+imageName+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
newWindow.document.write('</embed></object>'); }else{
newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">'); }
newWindow.document.write('</body></html>');
newWindow.document.close();
newWindow.focus();
}
Si toutefois quelqu'un à une réponse à mon message précédent, ça ne fera pas de mal d'en savoir un peu plus...
merci
Réponses
|