js对联广告封装类代码

时间:2010-04-14 12:15:20  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>滑动门通用JS</title><style type="text/css"><!--body{margin:0px;padding:0px;font-size:12px;background:#eee;line-height:20px;}.bodyer{width:760px;margin:20px auto auto;border:1px dotted #ccc;background:...
  正文:<!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=gb2312" />
<title>滑动门通用JS</title>
<style type="text/Css">
<!--
body{margin:0px;padding:0px;font-size:12px;background:#eee;line-height:20px;}
.bodyer{width:760px;margin:20px auto auto;border:1px dotted #ccc;background:#fff;}
.t_rt{text-align:right;}
h1,h2,h3,h4,h5,h6{font-weight:bold;margin:0px;padding:0px;font-size:12px;}
ul,li{margin:0px;padding:0px;}
li{list-style-type:none;}
h1{margin:10px;padding-right:10px;padding-bottom:5px;border-bottom:1px dotted #ccc;}
.preview{margin:10px;padding:10px;overflow:hidden;background:#eee;}
.cont{padding:10px;}
.cls{clear:both;}
.hidden{display:none;}
#sourse{border:1px dotted #ccc;width:600px;height:300px;margin:0px auto;}
.textDiv{margin:10px 40px 10px;text-align:center;}
h2{margin:0px 10px;background:#ccc;padding:5px;}
.example{margin:10px;background:#FFF;border:1px dotted #ccc;padding:10px;}
.authorInfo{width:760px; margin:10px auto 10px;text-align:center;}
.c_666{color:#666;}
.scrolldoorFrame{width:400px;margin:0px auto;overflow:hidden;}
.scrollUl{width:400px;border-bottom:1px solid #CCC;overflow:hidden;height:35px;}
.scrollUl li{float:left;}
.bor03{border:1px solid #ccc;border-top-width:0px;}
.sd01{cursor:pointer;border:1px solid #CCC;background:#FFF;margin:5px;padding:2px;font-weight:bold;}
.sd02{cursor:pointer;border:0px solid #CCC;margin:5px;padding:2px;}
-->
</style>
<script type="text/JavaScript">
/*
十三妖
qq:181907667
msn:wl181907667@hotmail.com
邮箱:thirdteendevil@163.com
*/
function floatAdver(){
 this.fDivs = new Array();//浮动广告对象数组
 this.divCount = 0 ; //浮动广告对象数量
 this.h = 200;//距离顶部距离
 this.fDiv;
 this.lDiv = "";
 this.rDiv = "";
 this.lDivCssText = "position:absolute;top:0px;left:10px;width:100px;height:200px;border:1px solid #666;overflow:hidden;";
 this.rDivCssText = "position:absolute;top:0px;right:10px;width:100px;height:200px;border:1px solid #666;overflow:hidden;";
 this.lDivInner = "";
 this.rDivInner = "";
}
floatAdver.prototype = {
 createInfo:function(lcss,rcss,linfo,rinfo,h){ //设置两边浮动层信息
  this.lDivCssText += lcss;
  this.rDivCssText += rcss;
  this.lDivInner = linfo;
  this.rDivInner = rinfo;
  this.h = h;
 },
 createFloatDiv:function(){ // 创建2个浮动层
  this.lDiv = document.createElement("div");
  this.rDiv = document.createElement("div");
  this.lDiv.style.cssText = this.lDivCssText;
  this.rDiv.style.cssText = this.rDivCssText;
  this.lDiv.innerHTML = this.lDivInner;
  this.rDiv.innerHTML = this.rDivInner;
  document.body.appendChild(this.rDiv);
  document.body.appendChild(this.lDiv);
  //this.rDiv.id="r";
  //this.lDiv.id="l";
  this.divCount++;
 },
 createAdvPro:function(){ //类内部创建层的浮动过程
  var bodyScrollTop = document.documentElement.scrollTop; 
  if(this.rDiv != bodyScrollTop + this.h)
  {
   this.$(this.rDiv).style.top = parseInt(this.$(this.rDiv).style.top) + Math.ceil((bodyScrollTop + this.h - parseInt(this.$(this.rDiv).style.top))/20) + "px";
   this.$(this.lDiv).style.top = this.$(this.rDiv).style.top;
"js对联广告封装类代码"由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Programming/JavaScript/13625.html

 1/4    1 2 3 4 下一页 尾页


关键字:

关于《js对联广告封装类代码》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td