Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Show div on link rollover

// Show div on link rollover

<html>
<head>
<script>
function layerSetup(id,visibility){
if(document.getElementById){
this.obj = document.getElementById(id).style;
this.obj.visibility = visibility;
return this.obj;}
else if(document.all){
this.obj = document.all[id].style;
this.obj.visibility = visibility;
return this.obj;}
else if(document.layers){
this.obj = document.layers[id];
this.obj.visibility = visibility;
return this.obj;}
}
function visVisible(param){
new layerSetup(param,'visible');
}

function visHidden(param){
new layerSetup(param,'hidden');
}
script>
</head>

<body>
<a href="#" onmouseover="visVisible('id1')" onmouseout="visHidden('id1')">SHOW1a> 
SHOW2</a>
<a href="#" onmouseover="visVisible('id3')" onmouseout="visHidden('id3')">SHOW3a>



You need to create an account or log in to post comments to this site.