Page 1 of 1

Where should I call this Javascript function? Smooth Gallery

Posted: Sun Dec 02, 2007 11:54 am
by Trenchant
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I'm setting up Smooth Gallery for a client.  If you go into the gallery you will notice you can click on an image and it will show a larger version.  I'm running into trouble with the back button though.  I can't figure out where to put the code to switch to a specific image.

http://www.toddberger.ca/galleries.php

This is the javascript used to call the gallery.  Before this I listed all the images and galleries.

[syntax="javascript"]<script type="text/javascript">
function startGallery() {
var myGallerySet = new gallerySet($('myGallerySet'), {
timed: false
});
}
window.addEvent('domready', startGallery);
myGallery.goTo(0);
</script>
I've tried several different places but can't get it to work. I've also tried JonDesign.net's website but it's been overrun by spambots. I'm hoping this is a just a case of me not knowing javascript and making a mistake.


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Sun Dec 02, 2007 2:10 pm
by John Cartwright
Try taking a look at the example source code at http://www.toddberger.ca/galleries.php

FF: > View > Page Source
IE: > View > Source

Posted: Sun Dec 02, 2007 5:00 pm
by Trenchant
Thats where the above code is from.

Sorry I never specified. This line in particular is the one I need to know where to place:

Code: Select all

myGallery.goTo(0); 
I'm not sure where I should call it. With 0 in the function it should show the first image but it doesn't. I've never worked with javascript variables or functions before so I'm not entirely sure what to do. There example/FAQ area only says to include that line.

Posted: Tue Dec 04, 2007 6:53 pm
by Trenchant
I got a hold of the guy who put the software together. He recommended using a new history features and it's now working.