<html>
<head><title>右下角弹出层(可最小化)兼容IE火狐 - LIEHUO.NET</title>
<style type="text/css">
<!--
*{margin:0;padding:0;}
body{text-align:center;}
#main{border:red 1px solid;width:1000px;height:1600px;margin:0 auto;}
#main #Layer3{width:400px;height:150px;border:green 1px solid;text-align:left;position:absolute;visibility:hidden;}
#main #Layer3 #open{float:left;text-align:center;width:360px}
#main #Layer3 #close{float:right;}
// -->
</style>
</head>
<body ><div id="main">
<div id="Layer3"><div id="open" οnmοuseοver="openbox();"> <a href="http://www.liehuo.net/" _fcksavedurl="http://www.liehuo.net/" οnclick="openbox()">点击访问烈火网(LIEHUO.NET)</a> </div>
<div id="close"><a href="#" _fcksavedurl="#" οnclick="closebox()" >关闭</a><script type="text/javascript">
<!--
var Layer3=document.getElementById("Layer3")
var main=document.getElementById("main")
/*Layer3层开始设为隐藏,不然开始的时候会不出现在底部,这里通过跟js代码同步条镇,使scroll层开始就出现在左底*/
Layer3.style.visibility="visible"
function runright()
{
/*这里-4主要是为了显示的比较好,因为我设置了边框*/
Layer3.style.top=document.body.scrollTop+document.body.clientHeight-Layer3.clientHeight-4+"px"
Layer3.style.rigth=document.body.scrollLeft+document.body.clientWidth-Layer3.clientWidth-4+"px"
/*隔一段时间执行这个函数*/
setTimeout("runright()",30)
}
/*关闭:设置高度一直减*/
function closebox()
{
Layer3.style.height=scroll.offsetHeight-4+"px"
//if (Layer3.offsetHeight>20)
// {
// setTimeout("closebox()",5)
// }
// else
// {
Layer3.style.visibility="hidden"
// }
}
function openbox()
{
if (Layer3.offsetHeight<148)
{
Layer3.style.visibility="visible"
Layer3.style.height=Layer3.offsetHeight+2+"px"
setTimeout("openbox()",5)
}
}
//www.liehuo.net
runright();
// -->
</script>
</div>
</div>
</div>
</body>
</html>
文章源自:烈火网,原文:http://www.liehuo.net/a/200909/148716.html
右下角弹出层
最新推荐文章于 2023-04-20 15:57:10 发布