JS+CSS漂亮的滑出提示层

---------------------------------------------------------------------------
<html>
<head>
<title>滑出层</title>
<script>
var flag=0;
function f_s(id){
var obj=document.getElementById(id);
obj.style.display="block";
obj.style.height="1px";

var changeW=function(){
var obj_h=parseInt(obj.style.height);
if(obj_h<=335){
obj.style.height=(obj_h+Math.ceil((335-obj_h)/10))+"px";
}
else{
clearInterval(bw1);
}
}
bw1= setInterval(changeW,1);
if(flag>0){
clearInterval(bw2);
}
}
function closeW(id){
flag++;
var obj=document.getElementById(id);
var closeDiv=function(){

clearInterval(bw1);
var obj_h=parseInt(obj.style.height);
if(obj_h>1){
obj.style.height=(obj_h-Math.ceil(obj_h)/10)+"px";

}
else{
clearInterval(bw2);
obj.style.display="none";
}
}
bw2= setInterval(closeDiv,1);
//alert(flag)
}
function showDiv(){
var ele = document.getElementById("div1");
clearInterval(bw1);
clearInterval(bw2);
ele.style.display = "block";
ele.style.height = 335 + "px";


}
</script>
</head>
<body>
<div οnmοuseοver="f_s('div1')" οnmοuseοut="closeW('div1')" style=" position:absolute;background:black; left: 536px; top: 36px; width: 150px; height: 22px;padding:8px;color:white;font-size:9pt;">详细介绍……</div>
<div id="div1" style="position:absolute;background:aqua;padding:8px;font-size:9pt;left:451px;overflow:hidden;top:68px;width:330px;display:none" οnmοuseοver="showDiv()" οnmοuseοut="closeW('div1')">一年之计在于春,一天之计在于晨,抓紧每一分一秒,努力奋斗……</div& gt;
</body>
</html>

原文地址:http://bbs.lampbrother.net/read-htm-tid-120007.html

<script type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/buttonLite.js#style=-1&uuid=&pophcol=3&lang=zh"></script> <script type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/bshareC0.js"></script>
阅读(193) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值