b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

漂浮广告代码 兼容_Javas漂浮广告代码_网页怎么做漂浮广告

电脑杂谈  发布时间:2017-06-06 16:03:46  来源:网络整理
漂浮广告代码 兼容

用js实现右下角qq漂浮广告代码兼容多浏览器,个人感觉不错,收藏下。漂浮广告代码 兼容

js漂浮广告代码,适用于以下浏览器:

ie6 7 8

ff3.5 3.6

chrome 4.1.2

safari

主要代码:

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "">

<html xmlns="">

<head>

<meta. http-equiv="content-type" content="text/html; charset=gbk" />

<title>右下角广告代码_</title>

<style>

html,body{

padding:0;

margin:0;

}

</style>

</head>

<body>

<div id="aa" style="width:100px;height:100px;background:#c0c0c0;" >我在随平滚</div>

<div id="bb" style="width:100px;height:100px;background:#c0c0c0;" >我静止不动</div>

<div style="width:100%;height:1500px;background:#000"></div>

<div style="width:100%;height:1500px;background:green"></div>

<div style="width:100%;height:1500px;background:red"></div>

</body>

</html>

<script>

function scrollx(p){

var d = document,dd = d.documentelement,db = d.body,w = window,o = d.getelementbyid(p.id),ie6 = /msie 6/i.test(navigator.useragent),style,timer;

if(o){

o.style.csstext +=";position:"+(p.f&&!ie6?'fixed':'absolute')+";"+(p.l==undefined?'right:0;':'left:'+p.l+'px;')+(p.t!=undefined?'top:'+p.t+'px':'bottom:0');

if(p.f&&ie6){

o.style.csstext +=';left:expression(documentelement.scrollleft + '+(p.l==undefined?dd.clientwidth-o.offsetwidth:p.l)+' + "px");top:expression(documentelement.scrolltop +'+(p.t==undefined?dd.clientheight-o.offsetheight:p.t)+'+ "px" );';

dd.style.csstext +=';background-image: url(about:blank);background-attachment:fixed;';

}else{

if(!p.f){

w.onresize = w.onscroll = function(){

clearinterval(timer);

timer = setinterval(function(){

//双选择为了修复chrome 下xhtml解析时dd.scrolltop为 0

var st = (dd.scrolltop||db.scrolltop),c;

c = st - o.offsettop + (p.t!=undefined?p.t:(w.innerheight||dd.clientheight)-o.offsetheight);

if(c!=0){

o.style.top = o.offsettop + math.ceil(math.abs(c)/10)*(c<0?-1:1) + 'px';

}else{

clearinterval(timer);

}

},10)

}

}

}

} //js漂浮广告代码

}

scrollx({

id:'aa'

})

scrollx({

id:'bb',

l:0,

t:200,

f:1

})

/*

id 要滚动的内容的id

l 横坐标的位置 不写为紧贴右边

t 你要放在页面的那个位置默认是贴着底边 0是贴着顶边

f 1表示固定 不写或者0表示滚动

*/

</script>

您可能感兴趣的文章:

js右下角与漂浮广告代码 兼容多浏览器

JS右下角悬浮广告代码的简单示例

js左右悬浮广告(兼容谷歌)的实例代码

js全屏漂浮广告代码 移入光标停止移动

js漂浮广告代码示例

js右侧漂浮广告的小例子

js随机漂浮广告代码示例

JS全屏漂浮广告、移入光标停止移动

jQuery 右下角滑动弹出可关闭重现层完整代码

网页右侧漂浮广告窗口的js代码


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-51445-1.html

    相关阅读
      发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

      热点图片
      拼命载入中...