Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | DHTML | Q1408 [ previous next ]

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

©2018 Martin Webb