Where should I call this Javascript function? Smooth Gallery

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Trenchant
Forum Contributor
Posts: 291
Joined: Mon Nov 29, 2004 6:04 pm
Location: Web Dummy IS

Where should I call this Javascript function? Smooth Gallery

Post 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]
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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
User avatar
Trenchant
Forum Contributor
Posts: 291
Joined: Mon Nov 29, 2004 6:04 pm
Location: Web Dummy IS

Post 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.
User avatar
Trenchant
Forum Contributor
Posts: 291
Joined: Mon Nov 29, 2004 6:04 pm
Location: Web Dummy IS

Post 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.
Post Reply