...

View Full Version : onmouseout



fazzfarrell
02-16-2007, 03:14 PM
i have this command

<div id="offerings" onmouseover="switchMenu('ouroffer')">

this opens up a div tag and shows a message.

the i have another
<div id="about" onmouseover="switchMenu('oboutus')">

wich does the same,
and another and so on...

but I want it so that if you click one and it opens then you click the next on it closes any of the others that are open...

any one help?

vwphillips
02-16-2007, 03:50 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<title></title>
<script language="JavaScript" type="text/javascript">
<!--

var Last='d1';

function SwapDiv(id){
document.getElementById(Last).style.height='0px';
document.getElementById(id).style.height='100px';
Last=id;
}

//-->
</script></head>

<body>
<input type="button" value="D1" onclick="SwapDiv('d1');" >
<input type="button" value="D2" onclick="SwapDiv('d2');" >
<input type="button" value="D3" onclick="SwapDiv('d3');" >
<div id="d1" style="position:relative;overflow:hidden;width:200px;height:100px;background-Color:red;" ></div>
<div id="d2" style="position:relative;overflow:hidden;width:200px;height:0px;background-Color:green;" ></div>
<div id="d3" style="position:relative;overflow:hidden;width:200px;height:0px;background-Color:blue;" ></div>
</body>

</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum