PDA

View Full Version : Simple Gallery



Bernie Kruger
11-22-2009, 03:31 PM
http://www.dynamicdrive.com/dynamicindex4/simplegallery.htm

I am using this and it works just fine with FF and I have already published.

With IE6 I keep getting javascript errors and my son tested on IE8 with the same errors, for some reason I cannot upgrade to IE 7 on my machine (using XP Pro)

As most folk this side of the big pond still use IE as a default, I need a fix on this.

Here is the error I get


Line:35
Char:3
Error:Imagearray [...]0' is null or not an object
Code:0

If I edit the "0" in the .js file the error keeps on migrating to the following lines.

Links
http://www.lbk.co.za/Const/renovate/paving_and_rock_cladding.htm

I've looked at version 2.1 but I actually like this one better

Rgds

jscheuer1
11-22-2009, 03:45 PM
You have an extra comma here (highlighted) at the end of your imagearray:


<script type="text/javascript">

var mygallery=new simpleGallery({
wrapperid: "simplegallery1", //ID of main gallery container,
dimensions: [315, 300], //width/height of gallery in pixels. Should reflect dimensions
//of the images exactly
imagearray: [
//["path_to_image", "optional_link", "optional_linktarget", "optional_textdescription"]
["../Renovate/Images/RockClad/Complete.jpg", , ,"Rock Cladding in Stone finish"],
["../Renovate/Images/RockClad/RockClad.jpg", , ,"Rock Cladding in Stone finish" ],
["../Renovate/Images/RockClad/Courtyard.jpg", , , ],
["../Renovate/Images/RockClad/PoolPave.jpg", , , ],
["../Renovate/Images/RockClad/PoolPave1.jpg", , , "Constantia Octal Pavers"],
["../Renovate/Images/RockClad/Driveway.jpg", , ,"Ballito Pavers" ],
["../Renovate/Images/RockClad/lapa.jpg", , ,"Modular Cladding" ],
["../Renovate/Images/RockClad/IndoorPave.jpg", , ,"Franschoek Tiles" ],
["../Renovate/Images/RockClad/Rome.jpg", , ,"Rome Pavers"],
["../Renovate/Images/RockClad/Corner.jpg", , ,"Corner Stones"],
["../Renovate/Images/RockClad/Capstone.jpg", , ,"Cap Stones"],
["../Renovate/Images/RockClad/Kerbing.jpg", , , "Kerbing Stones"],
["../Renovate/Images/RockClad/Uvongo.jpg", , , "Uvongo Pavers"],
["../Renovate/Images/RockClad/Swellendam.jpg", , ,"Swellendam Tiles"],
["../Renovate/Images/RockClad/Paternoster.jpg", , ,"Paternoster Pavers" ],
["../Renovate/Images/RockClad/PaternosterHalf.jpg", , ,"Paternoster Half Pavers" ],
["../Renovate/Images/RockClad/Constantia.jpg", , ,"Constantia Pavers"],
["../Renovate/Images/RockClad/ConstantiaHalf.jpg", , ,"Constantia Half Pavers" ],
["../Renovate/Images/RockClad/SatinTiles.jpg", , ,"SatinTiles" ],
["../Renovate/Images/RockClad/MaricoTiles.jpg", , ,"Marico Tiles" ],
["../Renovate/Images/RockClad/ChakasPavers.jpg", , ,"Chakas Pavers" ],

],
autoplay: [true, 3500, 10], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //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>

This is technically a syntax error, but most browsers now correct for it (there was a time when none did), now - as far as I know - IE is the only holdover, though there may be others. In any case, get rid of it and things should be fine.

Bernie Kruger
11-22-2009, 04:00 PM
You have an extra comma here (highlighted) at the end of your imagearray:


<script type="text/javascript">

var mygallery=new simpleGallery({
wrapperid: "simplegallery1", //ID of main gallery container,
dimensions: [315, 300], //width/height of gallery in pixels. Should reflect dimensions
//of the images exactly
imagearray: [
//["path_to_image", "optional_link", "optional_linktarget", "optional_textdescription"]
["../Renovate/Images/RockClad/Complete.jpg", , ,"Rock Cladding in Stone finish"],
["../Renovate/Images/RockClad/RockClad.jpg", , ,"Rock Cladding in Stone finish" ],
["../Renovate/Images/RockClad/Courtyard.jpg", , , ],
["../Renovate/Images/RockClad/PoolPave.jpg", , , ],
["../Renovate/Images/RockClad/PoolPave1.jpg", , , "Constantia Octal Pavers"],
["../Renovate/Images/RockClad/Driveway.jpg", , ,"Ballito Pavers" ],
["../Renovate/Images/RockClad/lapa.jpg", , ,"Modular Cladding" ],
["../Renovate/Images/RockClad/IndoorPave.jpg", , ,"Franschoek Tiles" ],
["../Renovate/Images/RockClad/Rome.jpg", , ,"Rome Pavers"],
["../Renovate/Images/RockClad/Corner.jpg", , ,"Corner Stones"],
["../Renovate/Images/RockClad/Capstone.jpg", , ,"Cap Stones"],
["../Renovate/Images/RockClad/Kerbing.jpg", , , "Kerbing Stones"],
["../Renovate/Images/RockClad/Uvongo.jpg", , , "Uvongo Pavers"],
["../Renovate/Images/RockClad/Swellendam.jpg", , ,"Swellendam Tiles"],
["../Renovate/Images/RockClad/Paternoster.jpg", , ,"Paternoster Pavers" ],
["../Renovate/Images/RockClad/PaternosterHalf.jpg", , ,"Paternoster Half Pavers" ],
["../Renovate/Images/RockClad/Constantia.jpg", , ,"Constantia Pavers"],
["../Renovate/Images/RockClad/ConstantiaHalf.jpg", , ,"Constantia Half Pavers" ],
["../Renovate/Images/RockClad/SatinTiles.jpg", , ,"SatinTiles" ],
["../Renovate/Images/RockClad/MaricoTiles.jpg", , ,"Marico Tiles" ],
["../Renovate/Images/RockClad/ChakasPavers.jpg", , ,"Chakas Pavers" ],

],
autoplay: [true, 3500, 10], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //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>

This is technically a syntax error, but most browsers now correct for it (there was a time when none did), now - as far as I know - IE is the only holdover, though there may be others. In any case, get rid of it and things should be fine.

Thanx John, I was hoping you would still be here,:D helps dumbasses (old farts) like me to see the wood for the trees, fixed thanx.

Bernie