...

View Full Version : Changing links dynamically



clintonb
07-19-2010, 11:48 AM
I have a javascript function that changes the src and href of an image within a repeating function. If i call document.getelementbyid("image").src, i can change the image and by calling document.getelementbyid("image").Href, i am able to change the link. The problem i have now is that when the cursor goes over the image it gets the link location as a snapshot. If i leave my cursor and the image and link location changes, it does not update the snapshot and if i click on the new image it uses the previous link rather than the new one. The only way to get the new link is to move off the image and back on to get a new snapshot of the new link. Is there a way i can tell the javascript to change the image, link location and update the browser to the new link without moving the cursor.

VIPStephan
07-19-2010, 03:06 PM
Show us what you’ve got so far and we’ll tell you what to do.

Old Pedant
07-20-2010, 01:42 AM
problem i have now is that when the cursor goes over the image it gets the link location as a snapshot.
SO change your code. Save only the object reference to the image as your "snapshot" and go get the href by way of that reference only when it is finally needed.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum