PDA

View Full Version : FrogJS: onClick?



radiofriendlybox
02-19-2008, 07:47 PM
1) Script Title: FrogJS

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/frogjs/index.htm

3) Describe problem: the script automatically initializes the gallery when the page loads. is there a way to initialize it with an onclick function instead? for example, clicking on *LINK* initializes the gallery. i know i could simply link to a new page, but i'm trying to see if it's possible to keep everything on one page.

jscheuer1
02-20-2008, 05:18 AM
Just remove:


Event.observe(window, 'load', initFrog, false);

from the end of the frog.js file. Then you could have a link like:


<a href="#" onclick="initFrog();return false;">Get Hoppin'!</a>

But it might be a good idea to keep it hidden until the page has loaded. At the very least, place it after all of the markup for the gallery.

radiofriendlybox
02-20-2008, 08:23 PM
Just remove:


Event.observe(window, 'load', initFrog, false);

from the end of the frog.js file. Then you could have a link like:


<a href="#" onclick="initFrog();return false;">Get Hoppin'!</a>

But it might be a good idea to keep it hidden until the page has loaded. At the very least, place it after all of the markup for the gallery.


thanks jscheuer1!

it works perfect. in addition, i removed the "return false;" and it fixed another problem i had had. thanks again! you can see the example here for now: http://www.32-bits.com/example