I've created a Javascript that pops open a new window showing a full sized image when someone clicks a thumbnail image, and it closes automatically when they move the cursor off the thumbnail. It's a great way to preview an image without leaving the page and without having to manually close the pop up window. The problem is this: I'd like to have the JavaScript grab the alt text from whichever image is clicked and display it under the image in the pop up window. I can do it using an ID with the image (Get ElementById) but since you can only use one unique ID per page, I'd have to create a separate entry in the script for each ID. That's not practical for what I have in mind.
[update: Problem Solved] JavaScript Help Needed: Can You Solve My JavaScript Problem?
6
I've created a Javascript that pops open a new window showing a full sized image when someone clicks a thumbnail image, and it closes automatically when they move the cursor off the thumbnail. It's a great way to preview an image without leaving the page and without having to manually close the pop up window.
The problem is this: I'd like to have the JavaScript grab the alt text from whichever image is clicked and display it under the image in the pop up window. I can do it using an ID with the image (Get ElementById) but since you can only use one unique ID per page, I'd have to create a separate entry in the script for each ID. That's not practical for what I have in mind.
I'm using the document.write method to create the pop-up window code. Can anyone tell me how to take the alt text from a thumbnail on the main page and have it printed out under the full sized image in the pop-up window?
If you can you'll be my hero for the day!
The problem is this: I'd like to have the JavaScript grab the alt text from whichever image is clicked and display it under the image in the pop up window. I can do it using an ID with the image (Get ElementById) but since you can only use one unique ID per page, I'd have to create a separate entry in the script for each ID. That's not practical for what I have in mind.
I'm using the document.write method to create the pop-up window code. Can anyone tell me how to take the alt text from a thumbnail on the main page and have it printed out under the full sized image in the pop-up window?
If you can you'll be my hero for the day!
- bestfriend
- [ 1 ] Thanks
- [1] reply
- Dennis Gaskill
- Dennis Gaskill
- bestfriend
- [ 1 ] Thanks
- Dennis Gaskill
Next Topics on Trending Feed
-
6