每天努力点吧

从心开始

浮动广告代码在网页两侧

<script language="javascript">
self.onError = null;

currentX = currentY = 0;

whichIt = null;

lastScrollX = 0; lastScrollY = 0;

NS = (document.layers) ? 1 : 0;

IE = (document.all) ? 1: 0;


function heartBeat(objectid) {

 if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }

 if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }

 if(diffY != lastScrollY) {

  percent = .1 * (diffY - lastScrollY);

  if(percent > 0) percent = Math.ceil(percent);

  else percent = Math.floor(percent);

  if(IE) {

   objectid = objectid.split(";");

   for (i = 0; i < objectid.length; i++) eval("document.all."+objectid[i]).style.pixelTop += percent;

  }

  if(NS) {

   objectid = objectid.split(";");

   for (i = 0; i < objectid.length; i++) eval("document."+objectid[i]).top += percent;

  }

  lastScrollY = lastScrollY + percent;

 }

 if(diffX != lastScrollX) {

  percent = .1 * (diffX - lastScrollX);

  if(percent > 0) percent = Math.ceil(percent);

  else percent = Math.floor(percent);

  if(IE) {

   objectid = objectid.split(";");

   for (i = 0; i < objectid.length; i++) eval("document.all."+objectid[i]).style.pixelLeft += percent;

  }

  if(NS) {

   objectid = objectid.split(";");

   for (i = 0; i < objectid.length; i++) eval("document."+objectid[i]).left += percent;   

  }

  lastScrollX = lastScrollX + percent;

 } 

}


if(NS || IE) action = window.setInterval("heartBeat('floater;floater1')", 2);
</script>

<div class="quote"><DIV id=floater1 style="Z-INDEX: 100; LEFT: 10px; VISIBILITY: visible; WIDTH: 100px; POSITION: absolute; TOP: 160px; height: 100px;">
左边的东西,可以是图片,表格
    <img src="images/left.gif" width="240" height="111"></DIV>
<DIV id=floater style="Z-INDEX: 100; RIGHT: 10px; VISIBILITY: visible; WIDTH: 100px; POSITION: absolute; TOP: 160px; left: 890px;">
右边的东西,可以是图片,表格<img src="images/1.jpg" width="140" height="104"></DIV>
<table width="200" border="1" align="center">
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><p>54656</p>
      <p>546546</p>
      <p>54</p>
      <p>645</p>
      <p>6</p>
      <p>54</p>
      <p>6</p>
      <p>54</p>
      <p>6</p>
      <p>45</p>
      <p>6</p>
      <p>45</p>
      <p>6</p>
      <p>4</p>
      <p>56</p>
      <p>4</p>
      <p>5</p>
      <p>6</p>
      <p>45</p>
      <p>6</p>
      <p>4</p>
      <p>56</p>
      <p>54</p>
      <p>6</p>
      <p>54</p>
      <p>65</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>54</p>
      <p>6</p>
      <p>45</p>
      <p>6</p>
      <p>54</p>
      <p>6</p>
      <p>54</p>
      <p>6</p>
      <p>5</p>
      <p>4</p>
      <p>645</p>
      <p>6</p>
      <p>45</p>
      <p>6</p></td>
    <td>&nbsp;</td>
  </tr>
</table>
</div>
<p>&nbsp;</p>
 

阅读更多
个人分类: javascript
想对作者说点什么? 我来说一句

网页动态滚动公告栏代码

2009年03月31日 6KB 下载

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭