浏览主站 | 站长工具 | 新闻资讯 | 站长学院 | 站长盈利 | HTML教程 | 网址导航 | 站长周刊 | 会员投稿 | 滚动新闻 | RSS
发新话题
打印

20行代码让你的网页内容随意滚动!

20行代码让你的网页内容随意滚动!

[[wiki]wiki[/wiki]][/wiki]<!DOC[wiki]type[/wiki]   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
  <html   [wiki]XML[/wiki]ns="http://www.w3.org/1999/xhtml">   
  <head>   
  <meta   http-equiv="Content-Type"   content="text/html;   charset=utf-8"   />   
  <title>无缝滚动</title>   
  </head>   
   
  <body>   
  <style>a{display:block;font-size:15px};</style>   
  <div   id="div1" style="width:300px;height:68px;overflow:hidden">  
  <div  id="div2" style="margin-top:0px;line-height:20px;">
      <a   href="javascript:">1,你可曾有过无数的梦想,</a>   
      <a   href="javascript:">2,却在时光的流逝里幻灭   </a>   
      <a   href="javascript:">3,你可曾对未来期待憧憬,</a>   
      <a   href="javascript:">4,却在成长的岁月中迷失</a>   
      <a   href="javascript:">5,CSDN中国[wiki]程序[/wiki]员论坛</a>   
      <a   href="javascript:">6,大家一起来</a>   
      <a   href="javascript:">7,好象都很不错的样子</a>   
  </div>
  </div>     
  <script>   
  function scrolln(id,samont,step){
  var  d=document.getElementById(id);
if(!d.scrolln){
if(step){d.step=step;d.samont=samont;}
d.scrolln=setInterval("scrolln('"+id+"')",d.samont);
d.onmou[wiki]SEO[/wiki]ver=function(){clearInterval(this.scrolln);this.scrolln=null;}   
  d.onmouseout=function(){scrolln(this.id)}
}
  var top=parseInt(d.style.marginTop);  
var lineheight=parseInt(d.style.lineHeight);
if(top>-lineheight){
    d.style.marginTop=(top-d.step)+"px";}
else{
do{
var o=d.firstChild;
d.removeChild(o);
d.appendChild(o);
}while(!d.firstChild.[wiki]TAG[/wiki]Name)
d.style.marginTop="0px";
}
  
  }
  scrolln("div2",100,2);
  </script>   
  <marq[wiki]UE[/wiki]e scrollamount=""
  </body>   
  </html>

TOP

好东东,虽然没有理解,但生搬用上了

TOP

看样子不错哦,套上看看效果

TOP

都是乱码?????

TOP

效果????

TOP

复制下来是乱码!

复制下来是乱码!去掉以后不能用!
看贴回贴喔,俺就这点要求!!
也 许 似 乎 大 概 是   然 而 未 必 不 见 得
小站:http://www.5i2008.com/
博客:http://blog.sina.com.cn/ewangfan

TOP

复制下来存到记事本中,保存再copy.OK!!!

TOP

发新话题