Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1408 How do I reveal a layer when a link in another layer is clicked?

irt.org | Knowledge Base | DHTML | Q1408 [ previous next ]

Q1408 How do I reveal a layer when a link in another layer is clicked?

Try:

<script language="JavaScript"><!--
function show(object) {
    if (document.layers && document.layers[object])
        document.layers[object].visibility = 'visible';
    else if (document.all) {
        document.all[object].style.visibility = 'visible';
        document.all[object].style.zIndex = 100;
    }
}
function hide(object) {
    if (document.layers && document.layers[object])
        document.layers[object].visibility = 'hidden';
    else if (document.all)
        document.all[object].style.visibility = 'hidden';
}
//--></script>

<div id="myId" style="position: relative; visibility: hidden;">Hidden Layer</div>

<div style="position: relative; visibility: visible;">
<a href="javascript:;" onClick="window.show('myId')">show layer</a>
<a href="javascript:;" onClick="window.hide('myId')">hide layer</a>
</div>

Feedback on 'Q1408 How do I reveal a layer when a link in another layer is clicked?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.