Forum Moderators: open

Message Too Old, No Replies

Dynamic Links

How do I modify links for a dynamic menu.

         

Conscientious Reject

4:01 am on Sep 7, 2005 (gmt 0)

10+ Year Member



I have a menu that needs to be completely modified, when a visitor clicks on a button. I am finally starting to understand javascript, and I am able to work fine with dom and element nodes. Still, I can't for the life of me figure out how to change a links actual function. I feel it would also help to tell you all that I am not using a href. Instead, the link will display a particular image, out of a list that also changes when a viewer decides to view a different gallery. I have also built most of the function to change the gallery, it's just the list of image links I need help changing.

garann

8:23 pm on Sep 7, 2005 (gmt 0)

10+ Year Member



Changing the function itself can be kind of a pain. Is there any way you can avoid it? If not, you could look at
attachEvent
and anonymous functions.

It's hard to guess at alternatives without knowing what your code's like, but can you keep your images in an array and just change the value in the array? Then your function can be called the same way every time and just reference the same index in the array.

Conscientious Reject

3:41 am on Sep 8, 2005 (gmt 0)

10+ Year Member



Sounds very possible, Ill give it a shot. Thanks for that, Ill keep you posted.

Conscientious Reject

5:20 am on Sep 8, 2005 (gmt 0)

10+ Year Member



Thanks it worked!