Results 1 to 3 of 3

Thread: FrogJS: onClick?

  1. #1
    Join Date
    Sep 2007
    Location
    west sacramento
    Posts
    25
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Cool FrogJS: onClick?

    1) Script Title: FrogJS

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ogjs/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.
    Last edited by radiofriendlybox; 02-20-2008 at 12:32 AM. Reason: changed question

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Just remove:

    Code:
    Event.observe(window, 'load', initFrog, false);
    from the end of the frog.js file. Then you could have a link like:

    HTML Code:
    <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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    radiofriendlybox (04-08-2008)

  4. #3
    Join Date
    Sep 2007
    Location
    west sacramento
    Posts
    25
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Talking

    Quote Originally Posted by jscheuer1 View Post
    Just remove:

    Code:
    Event.observe(window, 'load', initFrog, false);
    from the end of the frog.js file. Then you could have a link like:

    HTML Code:
    <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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •