kvarnerexpress 0 Report post Posted December 3, 2005 I'm trying to get a layer (in Netscape...) to respond to mouse clicks. Currently the text in the layer is a link and what I would like is for another layer to pop up when the link is clicked on (defining the word in the link) The problem is that I can't name each individual layer and use absolute references (there are a too many definitions) so I need to backtrace from the link to the layer it's in. I have no clue how to do this--I can acess the document of the bottom layer but I don't know how to get to the layer above (document.layers.parentLayer does not work)Any ideas? Share this post Link to post Share on other sites
chriswsk 0 Report post Posted December 19, 2005 Are you using javascript in href to call a function or javascript to show a layer? If yes, when calling the javascript code or javascript function, you can pass the current object (the layer that contains the link) to the function. For example, <script type="text/javascript"> function abc(currentObject){ // now you can get the layer without using id } </script> <a href="#" onclick="abc(this)">link</a> Using this method, you can let the function access the current layer without asigning any id to it. Hope that it is useful to you. I'm trying to get a layer (in Netscape...) to respond to mouse clicks. Currently the text in the layer is a link and what I would like is for another layer to pop up when the link is clicked on (defining the word in the link) The problem is that I can't name each individual layer and use absolute references (there are a too many definitions) so I need to backtrace from the link to the layer it's in. I have no clue how to do this--I can acess the document of the bottom layer but I don't know how to get to the layer above (document.layers.parentLayer does not work) Any ideas? 210349[/snapback] Share this post Link to post Share on other sites
Tyssen 0 Report post Posted December 19, 2005 DOM Tooltip might be what you're after. Share this post Link to post Share on other sites