x-Boy Posted April 26, 2009 Share Posted April 26, 2009 I'm using a gallery (JavaScript/jQuery) that loads the images from an array, and I'm using php to get the images and fill the JS array, it works OK with firefox, safari, chrome, etc. but not with InternetExplorer, it generates and error, the error alert is exposed below. Can somebody tell me how to make it work with IE7? Line: 35 Character: 3 Error: 'imagearray[...].0' is null or not an object Code: 0 <script type="text/javascript"> var mygallery=new simpleGallery({ wrapperid: "simplegallery1", //ID of main gallery container, dimensions: [532, 675], //width/height of gallery in pixels. Should reflect dimensions of the images exactly [250, 180 imagearray: [ <?php $imagegallery = $gallery; foreach(glob("galleries/".$imagegallery."/small/*.jpg") as $smallimage) { list($width, $height, $type, $attr) = getimagesize($smallimage); if ($width == 532 && $height == 675){ $largeimage = str_replace("small", "large", $smallimage); echo "[\"./$smallimage\", \"#\", \"openPopup('./$largeimage');\", \"\"],\n"; }else{} } ?> ], autoplay: [true, 5000, 5], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int] persist: false, //remember last viewed slide and recall within same session? fadeduration: 1000, //transition duration (milliseconds) oninit:function(){ //event that fires when gallery has initialized/ ready to run //Keyword "this": references current gallery instance (ie: try this.navigate("play/pause")) }, onslide:function(curslide, i){ //event that fires after each slide is shown //Keyword "this": references current gallery instance //curslide: returns DOM reference to current slide's DIV (ie: try alert(curslide.innerHTML) //i: integer reflecting current image within collection being shown (0=1st image, 1=2nd etc) } }) </script> Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 26, 2009 Share Posted April 26, 2009 When you view the code in the browser, is the imgagallery[] array filled? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.