Bundy <bigbadbundyREMOVETHIS@vfemail.netwrites:
Quote:
**********Problem with this function*******************
function mouse_out (var1, var2)
{
if(event.toElement !=var2 )
{
document.getElementById(var1).style.left = -1000;
document.getElementById(var1).style.top = -1000;
|
Two problems:
- Moving a div off the screen is not the best way to make it invisible.
Making it invisible is:
document.getElementById(var1).style.visibility = "hidden";
// "visible" is the opposite.
- You are setting CSS properties incorrectly. CSS requires a unit on
all lengths (except 0, and it doesn't hurt there either), so even if
this was what you wanted to do, it should be:
var elem = document.getElementById(var1);
elem.style.left = -1000 + "px";
elem.style.top = -1000 + "px";
/L
--
Lasse Reichstein Nielsen -
lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'