Wenn ich die Funktion aufrufe, funktioniert es. Rufe ich sie aber, *ohne* das Popup vorher zu schließen, nochmal auf (mit anderen Parametern), so scheint die Ausführung des Skriptes beim window.open aufzuhören.
Dies sollte eigentlich trotzdem funktionieren, uploade dochmal den ganzen source-code
gruß urmel
Nun denn:
function mediapopup(file,width,height,type) {
newwidth = width + 36;
if (type == "qt") { newheight = height + 48; mediaheight = height + 16; }
else { newheight = height + 36; }
var MediaWin = open("/assets/media.html","MediaViewer","width=" + newwidth + ",height=" + newheight + ",screenX=100,screenY=100,resizable=yes,scrollbars=yes,menubar=no,status=yes");
MediaWin.document.write('<html><head><title>MYSTerium.ch Media Viewer: ' + file + '</title></head><body><center>');
if (type == "qt") { MediaWin.document.write('<embed src="' + file + '" type="video/quicktime" width="' + width + '" height="' + mediaheight + '" autoplay="true" controller="true" cache="true" title="Please note that the above content is likely copyrighted material and not free for use.">'); }
else { MediaWin.document.write('<img src="' + file + '" width="' + width + '" height="' + height + '" border="0" title="Please note that the above content is likely copyrighted material and not free for use."/>'); }
MediaWin.document.write('</body></html>');
MediaWin.status = 'Please note that the above content is likely copyrighted material and not free for use.';
}
Das ist die Funktion. Aufgerufen wird sie z.B. mit
javascript:mediapopup('http://internal.mystfans.com/assets/myst/screenshots/mystisland_01.jpg',544,333)
oder mit
javascript:mediapopup('http://www.mysterium.ch/assets/myst/movies/tvspot.mov',160,120,'qt')
. Im letzten Fall wird noch zusätzlich definiert, dass es sich um ein QuickTime-Movie handelt. Ich hoffe, du blickst da durch ;)