S
Simon Wigzell
I pulled some 3rd party code off the internet that makes a span visible on
mouseover of a link. It works fine in IE, doesn't work for Netscape, it goes
into "Unknown", see it here :
http://www.studioapriori.com/cavendishSimon/divtest.htm How can I make it
work for all browsers? (Within reason of course!)
<html>
<head>
<style type="text/css"><!--
..absolute { position:absolute; visibility:hidden; }
//--></style>
</head>
<body>
<script language="JavaScript"><!--
function showOffset(object,x,y) {
if (document.layers && document.layers[object]) {
document.layers[object].left += x;
document.layers[object].top += y;
document.layers[object].visibility = 'visible';
}
else if (document.all) {
document.all[object].style.posLeft = document.all[object].offsetLeft
+ x;
document.all[object].style.posTop = document.all[object].offsetTop +
y;
document.all[object].style.visibility = 'visible';
}
else {
alert("Unknown");
}
}
function hideOffset(object,x,y) {
if (document.layers && document.layers[object]) {
document.layers[object].visibility = 'hidden';
document.layers[object].left -= x;
document.layers[object].top -= y;
}
else if (document.all) {
document.all[object].style.visibility = 'hidden';
document.all[object].style.posLeft -= x;
document.all[object].style.posTop -= y;
}
}
//--></script>
<span id="myLayer6" class="absolute"><img src="img/privacy_policy_roll.gif"
width="219" height="150"></span>
<a href="nextpage.htm" onMouseover="showOffset('myLayer6',100,100)"
onMouseout="hideOffset('myLayer6',100,100)">example 6</a>
</body>
</html>
mouseover of a link. It works fine in IE, doesn't work for Netscape, it goes
into "Unknown", see it here :
http://www.studioapriori.com/cavendishSimon/divtest.htm How can I make it
work for all browsers? (Within reason of course!)
<html>
<head>
<style type="text/css"><!--
..absolute { position:absolute; visibility:hidden; }
//--></style>
</head>
<body>
<script language="JavaScript"><!--
function showOffset(object,x,y) {
if (document.layers && document.layers[object]) {
document.layers[object].left += x;
document.layers[object].top += y;
document.layers[object].visibility = 'visible';
}
else if (document.all) {
document.all[object].style.posLeft = document.all[object].offsetLeft
+ x;
document.all[object].style.posTop = document.all[object].offsetTop +
y;
document.all[object].style.visibility = 'visible';
}
else {
alert("Unknown");
}
}
function hideOffset(object,x,y) {
if (document.layers && document.layers[object]) {
document.layers[object].visibility = 'hidden';
document.layers[object].left -= x;
document.layers[object].top -= y;
}
else if (document.all) {
document.all[object].style.visibility = 'hidden';
document.all[object].style.posLeft -= x;
document.all[object].style.posTop -= y;
}
}
//--></script>
<span id="myLayer6" class="absolute"><img src="img/privacy_policy_roll.gif"
width="219" height="150"></span>
<a href="nextpage.htm" onMouseover="showOffset('myLayer6',100,100)"
onMouseout="hideOffset('myLayer6',100,100)">example 6</a>
</body>
</html>