loamguy1
12-16-2008, 03:40 PM
SUMMARY:
I have a web page where I'm trying to have the same area on the page get updated when each of 3 small album images gets clicked. When I used DOM Level 0 event handling, it worked fine. However, I am at the point where I want mutiple things to happen at the mouse click of the smaller images, so I am trying to use DOM Level 2 scripting using addEventListener/attachEvent.
There is still only one event happening per the "onclick" of the small images, so I'm just trying to get the event handling set up correctly.
PROBLEM
When I try to retrieve the event that was clicked from the event framework, the object looks empty, or rather, I'm not sure how to interpret the results. If I display the clicked object with an alert for evt.srcElement or evt.target I get this: [object HTMLImageElement]. Then when I try and get the id of the object that was clicked, which is an <a> element, there's nothing there.
Here's the web page in question (working on alignment): http://www.loamband.com/gid_test.php
If you click the 3 images on the left, you'll see the alert with the object target displayed.
I have the same issue in both IE and FF.
Any help is appreciated!
I have a web page where I'm trying to have the same area on the page get updated when each of 3 small album images gets clicked. When I used DOM Level 0 event handling, it worked fine. However, I am at the point where I want mutiple things to happen at the mouse click of the smaller images, so I am trying to use DOM Level 2 scripting using addEventListener/attachEvent.
There is still only one event happening per the "onclick" of the small images, so I'm just trying to get the event handling set up correctly.
PROBLEM
When I try to retrieve the event that was clicked from the event framework, the object looks empty, or rather, I'm not sure how to interpret the results. If I display the clicked object with an alert for evt.srcElement or evt.target I get this: [object HTMLImageElement]. Then when I try and get the id of the object that was clicked, which is an <a> element, there's nothing there.
Here's the web page in question (working on alignment): http://www.loamband.com/gid_test.php
If you click the 3 images on the left, you'll see the alert with the object target displayed.
I have the same issue in both IE and FF.
Any help is appreciated!