Layering Question

They have: 38 posts

Joined: Dec 2002

I have a script that allows a layer to open when a link is clicked.

I have to have 2 links on the page. How can i change the script so that it opens 2 different layers from the same script?

<script language="JavaScript"></script>

dk01's picture

He has: 516 posts

Joined: Mar 2002

I have made a little tutorial on hiding and showing layers here:
http://www.conxiondesigns.com/tutorials/hideshow/

It makes it simple to run hide/show on many layers without having to write tons of code. If you have q's about it feel free to ask.
-dk

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Nice code, great explanation -- can I request you fix the href to something more accessible/usable? for instance, using return false to kill it, instead of javascript: void; and then putting href="/" or better yet, a link to alternative content that will display for folks without JavaScript.

dk01's picture

He has: 516 posts

Joined: Mar 2002

I'll look into that. I have seen that used but return false kills animated gifs in many browsers. So far I have looked at this code and no browser has had problems with it. I would try to add the like but some browsers process onClick before the href="" and some do it after. I was thinking of using onmousedown but that does not work wonderfully in ns4 i hear. Maybe I will add a note on the about how you can use other things. Its sorta an ongoing tutorial as you can tell from the extension. Thanks for the suggestion. Will look at it again.
-dk

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

return false has never killed anything that I've seen, can you demonstrate?

Seriously, i've been using it for popup windows for years.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

dk01's picture

He has: 516 posts

Joined: Mar 2002

See this link: http://www.experts-exchange.com/Web/Q_11543359.html
In the conversation they don't really get anywhere because one of them experiences problems and the other doesn't. The two don't mention the version of browser that they use so its hard to tell but I remember seeing a conversation about this previously on this or another forum. Would you be alright if I used?:

I am not even sure it would work but maybe I can test it out. Anyways I am going to bed and am off to Poland tomorrow. Will be back Sunday. Have a good week.
-dk

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.