Multiple instances of a javascript on a page, help!

Discussion in 'JavaScript' started by mpvirgo, Oct 29, 2007.

  1. #1
    I have a very rough template of a site up, and I am stumped at how to continue!
    http://www.thinkhousedesign.com/scroll/index4.html

    the original javascript I used is found here:
    http://www.thinkhousedesign.com/scroll/finder.js
    I don't know a ton about javascript (or much at all really), but what I need to do is have the same menu that is occurring in the "services" section be able to happen on the "spa escapes" section as well, and on other sections.
    I tried to duplicate the IDs being used in the CSS and javascript and adding a "2" at the end, so i could have it function identically... but as soon as i do that, the "#finder2" (spa escapes section) menu works, but then "#finder" (services section) doesn't anymore! it seems I can only have one "instance" of this type of menu happening on a page at any time.
    http://www.thinkhousedesign.com/scroll/finder3.js (this is the file i monkeyed with, but i'm sure i don't have the proper syntax or something)

    Can anyone tell me what I am doing wrong, or tell me if this isn't possible?
    I would really appreciate it!

    Thanks!
     
    mpvirgo, Oct 29, 2007 IP