2011-01-04 00:51
Testa de här :)
<--------HTML-------->
[code:
<ul id="dropdown">
<li><a href="#">Home</a>
<div id="tab1"
>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
</div>
</li>
<li><a href="#">Download</a>
<div id="tab2"
>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
</div>
</li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#">t</a></li>
</ul>
<div style="clear:both"></div>
[/code]
<--------CSS-------->
[code:
#dropdown
{ margin: 0;
padding: 0;
z-index: 30}
#sddm li
{ margin: 0;
padding: 0;
list-style: none;
float: left;
font: bold 11px arial}
#dropdown li a
{ display: block;
margin: 0 1px 0 0;
padding: 4px 10px;
width: 60px;
background:
#5970B2;
color:
#FFF;
text-align: center;
text-decoration: none}
#dropdown li a:hover
{ background:
#49A3FF}
#dropdown div
{ position: absolute;
visibility: hidden;
margin: 0;
padding: 0;
background:
#EAEBD8;
border: 1px solid
#5970B2}
#dropdown div a
{ position: relative;
display: block;
margin: 0;
padding: 5px 10px;
width: auto;
white-space: nowrap;
text-align: left;
text-decoration: none;
background:
#EAEBD8;
color:
#2875DE;
font: 11px arial}
#dropdown div a:hover
{ background:
#49A3FF;
color:
#FFF}
[/code]
<--------JAVASCRIPT-------->
[code:
var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;
function mopen(id)
{
mcancelclosetime();
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
ddmenuitem = document.getElementById(id);
ddmenuitem.style.visibility = 'visible';
}
function mclose()
{
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}
function mclosetime()
{
closetimer = window.setTimeout(mclose, timeout);
}
function mcancelclosetime()
{
if(closetimer)
{
window.clearTimeout(closetimer);
closetimer = null;
}
}
document
Tillägg av
Jonteex 2011-01-04 00:52
document.onclick = mclose; på slutet ....
And who are you? :)