Jul 24, 2008

Onclick In Layers

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > HTML, XML etc..

free web hosting

Onclick In Layers

kvarnerexpress
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?


Reply

chriswsk
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.

QUOTE(kvarnerexpress @ Dec 3 2005, 08:24 AM)
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?
*


 

 

 


Reply

Tyssen
DOM Tooltip might be what you're after.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:


Searching Video's for onclick, layers
advertisement



Onclick In Layers



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE