日期:2014-05-16  浏览次数:20427 次

求一段JS代码,关于层展开的,下班结帖
我想实现象卓越网上鼠标放到“所有20类商品”连接上出现层的那种效果,层是慢慢展开的。对javascript不熟悉。望高手写个运行起来可以看到效果的例子。
http://www.joyo.com/

------解决方案--------------------
把他的JS下载下来就成了!呵呵!干嘛还要自己写那么麻烦
------解决方案--------------------
<div style= "background-color:#999999;width:100px;text-align:center;
padding:3px;border-bottom:1px solid #FFFFFF;z-index:1; "
onmouseover= "myMenu.style.display= 'block ' "
onmouseout= "myMenu.style.display= 'none ' ">
<div style= "position:absolute;width:0px;height:0px;overflow:visible; ">
<div id=myMenu style= "position:absolute;left:-10px;top:25px;display:none;
width:90px;background-color:#CCCCCC;padding:5px;text-align:left; ">
<font color= "#FFFFFF "> &nbsp; <a href= "../fair_app/customer_b.php "> 1 </a> <br/>
<br/>
&nbsp; <a href= "../fair_app/quotation_b.php "> 2 </a> <br/>
<br/>
&nbsp; <a href= "../fair_app/fair_app_b.php "> 3 </a> <br/>
<br/>
&nbsp; <a> ... </a> <br/>
<br/>
</font> </div>
</div>
<font color= "#FFFFFF "> <a href=#none> <font size= "4 "> check </font> </a> </font> </div>
------解决方案--------------------
<div onmouseover= "stop();start(); "> here! </div>
<div id= "aaa " style= "border:1px solid blue; " onclick= "stop(); "> AAAAAA </div>

<script>
var Interval;
stop();
function start()
{
Interval=window.setInterval( "zoomIn() ",1);
}
function stop()
{
aaa.style.width=10;
aaa.style.height=10;
aaa.style.display= "none ";
window.clearInterval(Interval);
}
function zoomIn()
{
aaa.style.display= " ";
aaa.style.width=parseInt(aaa.style.width)+50;
aaa.style.height=parseInt(aaa.style.width)+10;
if(parseInt(aaa.style.width)> =400)
{
window.clearInterval(Interval);
}

}
</script>