没有合适的资源?快使用搜索试试~ 我知道了~
js控制右下角停留效果,最简便,全部浏览器测试通过
需积分: 10 4 下载量 68 浏览量
2011-05-04
17:12:01
上传
评论
收藏 3KB TXT 举报
温馨提示
试读
3页
js控制右下角停留效果,最简便///ie6 if(navigator.userAgent.indexOf("MSIE 6.0")!=-1){ if(flag) ie6Int(); var he=parseInt(pop.style.height.replace("px",""),10); var top=parseInt(pop.style.top.replace("px",""),10);
资源推荐
资源详情
资源评论
/*右下角广告*/
#pop{width:310px;position:fixed;right:17px;overflow:hidden;height:246px;}/**/
#pop img{margin:0;padding:0;border:0;display:block;}
#pop .close{width:43px;height:16px;display:block;position:absolute;right:8px;top:2px;overflow:hidden;background:url(http://image.sxmtxs.com/webimg/43_16.jpg);cursor:pointer;}
<div id="pop" style="bottom:-250px;">
<img src="http://image.sxmtxs.com/webimg/298_224_1.jpg" width="310" height="250" />
<div class="close" onmousedown="hidePop();"></div>
</div>
<script type="text/javascript">
//弹出窗口的div
var pop=document.getElementById("pop");var bott;
//弹出窗口的高度,包括边框
var popHeight=250;
var flag=true;
function ie6Int(){
pop.style.height="0px";pop.style.position="absolute";
pop.style.display="block";
pop.style.bottom="";pop.style.right="17px";
var beginTop=pop.style.top.replace("px","");
var scroll=document.documentElement.scrollHeight;
pop.style.top=parseInt(document.documentElement.clientHeight,10)+document.documentElement.scrollTop+"px";
window.onscroll=function(){
///当滚动条到最底时,不再继续滚动
if(parseInt(document.documentElement.clientHeight,10)+document.documentElement.scrollTop>=scroll) return;
var currScroll=parseInt(document.documentElement.clientHeight,10)-popHeight;
pop.style.top=document.documentElement.scrollTop+currScroll+"px";
#pop{width:310px;position:fixed;right:17px;overflow:hidden;height:246px;}/**/
#pop img{margin:0;padding:0;border:0;display:block;}
#pop .close{width:43px;height:16px;display:block;position:absolute;right:8px;top:2px;overflow:hidden;background:url(http://image.sxmtxs.com/webimg/43_16.jpg);cursor:pointer;}
<div id="pop" style="bottom:-250px;">
<img src="http://image.sxmtxs.com/webimg/298_224_1.jpg" width="310" height="250" />
<div class="close" onmousedown="hidePop();"></div>
</div>
<script type="text/javascript">
//弹出窗口的div
var pop=document.getElementById("pop");var bott;
//弹出窗口的高度,包括边框
var popHeight=250;
var flag=true;
function ie6Int(){
pop.style.height="0px";pop.style.position="absolute";
pop.style.display="block";
pop.style.bottom="";pop.style.right="17px";
var beginTop=pop.style.top.replace("px","");
var scroll=document.documentElement.scrollHeight;
pop.style.top=parseInt(document.documentElement.clientHeight,10)+document.documentElement.scrollTop+"px";
window.onscroll=function(){
///当滚动条到最底时,不再继续滚动
if(parseInt(document.documentElement.clientHeight,10)+document.documentElement.scrollTop>=scroll) return;
var currScroll=parseInt(document.documentElement.clientHeight,10)-popHeight;
pop.style.top=document.documentElement.scrollTop+currScroll+"px";
资源评论
gchg1030
- 粉丝: 8
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功