dedecms对联广告代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<style type="text/css">
#souabAds1{
position: absolute;
top: 10px;
left: 10px;
}
#souabAds2{
position: absolute;
top: 10px;
right: 10px;
}
</style>
</head>
<body>
<div id="souabAds1">
<a href="http://bbs.idcbs.com" target="_blank"><img src="http://ubmcmm.baidustatic.com/media/v1/0f000Qtp4iI1lPVETOCDsf.jpg" border="0"></a>
</div>
<div id="souabAds2">
<a href="http://bbs.idcbs.com" target="_blank"><img src="http://ubmcmm.baidustatic.com/media/v1/0f000Qtp4iI1lPVETOCDsf.jpg" border="0"></a>
</div>
<div style="height: 0px"></div>
<script type="text/javascript">
function StayPosition(speed)
{
this.objs = [];
this.speed = speed || 0.1;
this.timer = this.round = this.obj = this.end = null;
if(StayPosition.initialize !== true){
function correct(func, obj){
return function(){
func.call(obj);
}
}
StayPosition.prototype.start = function(){
this.timer = setInterval(correct(this.run, this), 33);
}
StayPosition.prototype.stop = function(){
clearInterval(this.timer);
}
StayPosition.prototype.capitalize = function(prop){return prop.replace(/^/, function(a){return a.toUpperCase();})}
StayPosition.prototype.add = function(dom, prop){
var offset = prop ? "offset" + this.capitalize(prop) : "offsetTop";
var scroll = prop ? "scroll" + this.capitalize(prop) : "scrollTop";
prop = prop ? prop : this.offset.slice(6).toLowerCase();
this.objs.push({"dom": dom, "prop": {"size": dom, "name": prop, "offset": offset, "scroll": scroll}});
}
StayPosition.prototype.run = function(){
for(var i = 0, l = this.objs.length; i < l; i++){
this.obj = this.objs;
this.end = (document.documentElement || document.body) + this.obj.prop.size;
if(this.end != this.obj.dom){
this.round = this.end - this.obj.dom > 0 ? Math.ceil : Math.floor;
this.obj.dom.style = this.obj.dom + this.round((this.end - this.obj.dom) * this.speed) + "px";
}
}
}
}
StayPosition.initialize = true;
}
var o = new StayPosition(0.2);
o.add(document.getElementById("souabAds1"), "top");
o.add(document.getElementById("souabAds2"), "top");
o.start();
//-->
</script>
</body>
</html>
页:
[1]