Closed Thread Icon

Preserved Topic: Hiding layers on mousemove Pages that link to <a href="https://ozoneasylum.com/backlink?for=17816" title="Pages that link to Preserved Topic: Hiding layers on mousemove" rel="nofollow" >Preserved Topic: Hiding layers on mousemove\

 
Author Thread
sseifert
Nervous Wreck (II) Inmate

From:
Insane since: Aug 2000

posted posted 08-01-2000 17:56

I´d like to construct a layer-based navigation that unfolds on a mouse event (In that particular case: onMouseOver on a link) and hides when the cursor leaves the layer.
In Netscape Navigator its no problem using the <layer>- tag, but as IE doesn´t react on <layer>, I see no other possibility than working with a move handler script. So I tried some but none of´em worked.
Does anybody hav a clue how to make it work?

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 08-01-2000 18:46

You are going to have problems using the <layer> tag. Try using <div> instead.

Then you can write a function like this.

<html>
<head>
<script>
// quick n' dirty browser detect
nn = (document.layers) ? 1:0;
ie = (document.all) ? 1:0;
// used for crossbrowser compatibility
if (nn) {
docObj = 'document.'
styleObj = '';
}
if (ie) {
docObj = 'document.all.';
styleObj = '.style';
}
//show function
function show(layer){
eval(docObj + layer + styleObj + '.visibility = "visible"');
}
// hide function
function hide(layer){
eval(docObj + layer + styleObj + '.visibility = "hidden"');
}
</script>
<style type="text/css">
#testDIV
{position:absolute; top: 137; left: 390; z-index: 501; visibility: hidden;}
a {font-size:10px; color:#FFDA4D; font-family: verdana;}
td {font-size:10px; color:#FFDA4D; font-family: verdana;}
</style>
</head>
<body bgcolor="#024563">
<a href="#" onMouseover="show('testDIV')" onMouseout="hide('testDIV')">
link 1</a>
<div id="testDIV">
<table WIDTH=100 HEIGHT=200>
<tr><td>
Stuff you want to show or hide
</td></tr></table>
</div>
</body>
</html>


Walking the Earth like Kane

« BackwardsOnwards »

Show Forum Drop Down Menu