In the HTML below I have a layer "Block1" and within that layer the blocks "black", "blue" and "red". I don't know if this is possible at all but I would like to make it so that if I hide "Block1" the layers "black", "blue" and "red" are hidden also (because they are within "Block1"). And if I make "Block1" visible, I have the choice to make the layers within either visible or hidden. I can't get it working myself. Can anyone tell me if this is possible at all or that there is maybe another trick do get the same result?
This is the HTML:
<html>
<head>
<script language="JavaScript1.2"><!--
// Show/Hide functions for non-pointer layer/objects
function showtext(id) {
// if (ns4) document.layers[id].visibility = "show"
//else if (ie4) document.all[id].style.visibility = "visible"
document.all[id].style.visibility = "visible"
}
function hidetext(id) {
// if (ns4) document.layers[id].visibility = "hide"
//else if (ie4) document.all[id].style.visibility = "hidden"
document.all[id].style.visibility = "hidden"
}
// -->
</script>
<style type="text/css"><!--
#black { position: absolute; top: 150px; left: 250px; width: 100px; height: 40px; color: #000000; font-size: 14pt; font-family: Arial; visibility: hidden }
#blue { position: absolute; top: 150px; left: 250px; width: 100px; height: 40px; color: #191970; font-size: 14pt; font-family: Arial; visibility: visible }
#red { position: absolute; top: 150px; left: 250px; width: 100px; height: 40px; color: #FF0000; font-size: 14pt; font-family: Arial; visibility: visible }
#block1 { position: absolute; top: 100px; left: 200px; width: 100px; height: 40px; visibility: visible }-->
</style>
</head>
<body>
<table>
<div id="block1">This is block1</div>
<tr>
<td>
<div id="Black">This is black text</div>
<div id="blue">This is blue text</div>
<div id="red">This is red text</div>
</td>
</td>
</table>
<a href="javascript:;" onclick="showtext('Black'); hidetext('blue'); hidetext('red')">Show black and hide blue and red<br>
<a href="javascript:;" onclick="showtext('blue'); hidetext('Black'); hidetext('red')">Show blue and hide black and red<br>
<a href="javascript:;" onclick="showtext('red'); hidetext('Black'); hidetext('blue')">Show red and hide black and blue<br>
<a href="javascript:;" onclick="showtext('block1')">Show Block1<br>
<a href="javascript:;" onclick="hidetext('block1')">Hide Block1<br>
</body>
</html>
Kippie
This is the HTML:
<html>
<head>
<script language="JavaScript1.2"><!--
// Show/Hide functions for non-pointer layer/objects
function showtext(id) {
// if (ns4) document.layers[id].visibility = "show"
//else if (ie4) document.all[id].style.visibility = "visible"
document.all[id].style.visibility = "visible"
}
function hidetext(id) {
// if (ns4) document.layers[id].visibility = "hide"
//else if (ie4) document.all[id].style.visibility = "hidden"
document.all[id].style.visibility = "hidden"
}
// -->
</script>
<style type="text/css"><!--
#black { position: absolute; top: 150px; left: 250px; width: 100px; height: 40px; color: #000000; font-size: 14pt; font-family: Arial; visibility: hidden }
#blue { position: absolute; top: 150px; left: 250px; width: 100px; height: 40px; color: #191970; font-size: 14pt; font-family: Arial; visibility: visible }
#red { position: absolute; top: 150px; left: 250px; width: 100px; height: 40px; color: #FF0000; font-size: 14pt; font-family: Arial; visibility: visible }
#block1 { position: absolute; top: 100px; left: 200px; width: 100px; height: 40px; visibility: visible }-->
</style>
</head>
<body>
<table>
<div id="block1">This is block1</div>
<tr>
<td>
<div id="Black">This is black text</div>
<div id="blue">This is blue text</div>
<div id="red">This is red text</div>
</td>
</td>
</table>
<a href="javascript:;" onclick="showtext('Black'); hidetext('blue'); hidetext('red')">Show black and hide blue and red<br>
<a href="javascript:;" onclick="showtext('blue'); hidetext('Black'); hidetext('red')">Show blue and hide black and red<br>
<a href="javascript:;" onclick="showtext('red'); hidetext('Black'); hidetext('blue')">Show red and hide black and blue<br>
<a href="javascript:;" onclick="showtext('block1')">Show Block1<br>
<a href="javascript:;" onclick="hidetext('block1')">Hide Block1<br>
</body>
</html>
Kippie
Comment