Archivlink: javarea.de Forum > JavaScript > js popup+mac kompatibilität
Vollständigen Link anzeigen: javarea.de Forum > JavaScript > js popup+mac kompatibilität

Pages: [1]

geschrieben von asnoopa am 11.04.2006 - 11:49
Hallo,
ich habe ein JS um Bilderpopups zu öffnen.
Die Popupgröße passt sich dabei automatsch der Bildgröße an.
Soweit funktioniert das ganze in den Browsern.

Nur beim Mac funktioniert das irgendwie nicht. Das Bild wird in dem Popup einfach nicht geladen.

Hat vielleicht jemand einen Lösungsansatz für mich?

Wäre net.. Danke.
Gruß asnoopa

PHP-Quelltext
1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: 
25: 
26: 
27: 
28: 
29: 
30: 
31: 
32: 
33: 
34: 
35: 
36: 
37: 
38: 
39: 
40: 
41: 
42: 
43: 
44: 
45: 
46: 
47: 
48: 
49: 
50: 
51: 
52: 
53: 
54: 
55: 
56: 
57: 
58: 
59: 
60: 
61: 
62: 
63: 

<?
<head>
</
head>
<
script type="text/javascript" language="javascript">
  
xSize 200;
  
ySize 100;
  
xPos = ((screen.width 5) * .2);
  
yPos = ((screen.height 5) * .5);
  if(
parseInt(navigator.appVersion.charAt(0)) >= 4) {
    var 
isNN = (navigator.appName == "Netscape") ? 0;
    var 
isIE = (navigator.appName.indexOf("Microsoft") != -1) ? 0;
  }
  var 
optNN =   'resizable=no,scrollbars=no,width='+xSize+',height='+ySize+',left='+xPos+',top='+yPos;
  var 
optIE =   'menubar=yes,resizable=yes,scrollbars=no,status=no,width=200,height=100,left='+xPos+',top='+yPos;

  function 
popimage(imageURL,imageTitle) {
    if(
isNN) {
      
imgWin window.open("about :blank","",optNN);
    }
    if(
isIE) {
      
imgWin window.open("about :blank","",optIE);
    }
    
with(imgWin.document) {
      
write('<html><head><meta http-equiv="imagetoolbar" content="no">'
      
'  <title>Loading...</title>'
      
'  <style type="text/css">body{margin:0px;overflow:hidden;}</style>'
      
'  <sc'+'ript type="text/javascript" language="javascript">'
      
'    var isNN,isIE;'
      
'    if(parseInt(navigator.appVersion.charAt(0)) >= 4) {'
      
'      isNN = (navigator.appName == "Netscape") ? 1 : 0;'
      
'      isIE = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;    }'
      
'    function resizeToimage() {'
      
'      if(isIE) {'
      
'        window.resizeTo(100,100);'
      
'        var width = (100 - (self.document.body.clientWidth - self.document.getElementById("image").width));'
      
'        var height = (100 - (self.document.body.clientHeight - self.document.getElementById("image").height));'
      
'        self.document.getElementById("loading_box").style.visibility = "hidden";'
      
'        self.resizeTo(width,height);      }'
      
'      if(isNN) {'
      
'        self.innerWidth = document.images["image"].width;'
      
'        self.innerHeight = document.images["image"].height + 50;'
      
'        self.document.loading_box.visibility = "hidden";      }    }'
      
'    function doTitle() {'
      
'      self.document.title = "'imageTitle +'";    }'
      
'    function init() {'
      
'      resizeToimage();'
      
'      doTitle();'
      
'      self.focus();    }'
      
'  </sc'+'ript></head>'
      
'<body bgcolor="ffffff" onload="init()">'
      
'  <div id="loading_box" style="position:absolute;top:40px;left:40px;"><font face="Verdana" size="1"><b>..Bild wird geladen!</b></font></div>'
      
'  <div id="image_box" style="display:block;cursorointer;"><img id="image" src="'imageURL +'" onclick="self.close()" title="Bild klicken um zu schließen" /></div>'
      
'</tr></td></table>'
      
'</body></html>');
    }
  
imgWin.location.reload();
  }
</script>

<body>
<A href="javascript:void(0);" onclick="popimage('Bild.jpg', 'Bild');">Bild öffnen</A>
</body>
?>


geschrieben von asnoopa am 12.04.2006 - 12:07
Wie macht Ihr Bild-PopUps, dass die auch beim Mac funktionieren?
Hat hier keiner eine Idee?



Powered by: JBB v.2.0.4 Copyright ©2000-2006, www.javarea.de.