This gallery code works in mozilla but not safari or explorer, does anyone why?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scardy
    New Member
    • Dec 2010
    • 4

    #1

    This gallery code works in mozilla but not safari or explorer, does anyone why?

    Code:
    var bild =new Array();
    bild[0]="enews_img/DT_01.jpg";
    bild[1]="enews_img/DT_02.jpg";
    bild[2]="enews_img/DT_03.jpg";
    bild[3]="enews_img/DT_04.jpg";
    bild[4]="enews_img/DT_05.jpg";
    bild[5]="enews_img/DT_06.jpg";
    bild[6]="enews_img/DT_07.jpg";
    
    
    
    var z = 0;
    
    function voran(){
    	z++;
    	if(z > 6){z=0}
    	var meinbild=document.getElementById("bild");
    	meinbild.src= bild[z];
    }
    
    function ruck(){
    	z--;
    	if(z < 0){z=6}
    	var meinbild=document.getElementById("bild");
    	meinbild.src= bild[z];
    }
    Last edited by Dormilich; Dec 14 '10, 10:28 AM. Reason: please use [CODE] [/CODE] tags when posting code
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    there’s no obvious thing in the shown code that would explain this. are there any error messages in the error console?


    mental note: document.getEle mentById("bild" ).src = "enews_img/DT_0" + ((z++ % 6) + 1) + ".jpg";
    Last edited by Dormilich; Dec 14 '10, 10:33 AM.

    Comment

    • scardy
      New Member
      • Dec 2010
      • 4

      #3
      here is the html that goes with the js
      Code:
       
      <td width="50px" align="left" valign="top">
      
      <input type="button" onclick ="ruck()" value="<<"onfocus="this.blur()" align="left" valign="top" />
      </td><td align="center" valign="top"><div class="bild"align="center">
      <img src="enews_img/En_01.jpg" id="bild" class="pix" /></td><td width="50px"align="right" valign="top">
      
      
      <input type="button" onclick ="voran()" value=">>" onfocus="this.blur()" align="right" /></td>
      I'm obviously a beginner, so any hints on what I should tell you for you to be able to see my problem would be appreciated. The error console (I used firebug) didn't show any errors...

      thanks!

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        The error console (I used firebug) didn't show any errors...
        and the error console in Safari?

        PS. is there any reason for this: onfocus="this.b lur()"?

        Comment

        • scardy
          New Member
          • Dec 2010
          • 4

          #5
          the safari also doesn't show up any errors:

          no reason for the onfocus="this.b lur()" I deleted it but it isn't the problem here.
          thanks.

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            for some yet to discover reason the wrapping div’s height is 0px. if you manually set it to an absolute value, you’ll see the image.

            PS. tables are not for making page layout!

            Comment

            • scardy
              New Member
              • Dec 2010
              • 4

              #7
              I know tables are terrible practice, I was trying to be quick and convert an html email into a page layout without re-doing the code, thankyou very much for your wonderful patience and help with this sloppy novice! thankyou!

              Comment

              Working...