- From: alex <shortestpath@yahoo.com>
- Date: Sun, 20 Jan 2002 21:56:25 -0800 (PST)
- To: www-dom@w3.org
I'm confused about how you actually go about implementing a dom interface. For example, I have an image and want it to respond to certain events. Using javascript... // my image has id="arrowUp" var arrowUp = document.getElementById("arrowUp"); // Now I have the arrowUp node, and nodes implement // the EventTarget interface; I add an event listener: arrowUp.addEventListener("mousedown", [listener], false); My problem is, I'm not sure what to put for [listener]. I read an article somewhere where you can just write the name of a javascript function that'll do whatever on the mousedown event on the image. (I've tried this, it worked.) However, I'd like to be able to have my arrowUp node (or image? which leads me to another question- is the arrowUp node and the arrowUp image synonymous at this point?) itself be the listener; that is, have something like: arrowUp.addEventListener("mousedown", arrowUp, false); But to do this, arrowUp has to implement the EventListener interface (someone please correct me if my thinking's all wrong here). I guess this is where my troubles come from. How do I make arrowUp implement the EventListener interface? Any help on this is *greatly* appreiciated! -alex __________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/
Received on Monday, 21 January 2002 01:31:33 UTC