内容向上滚动 javascript 不指定

Else , 2009/11/30 13:45 , 代码片段,演示也有 , Comments(0) , Reads(418) , Via Original
[hcode]<!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>Untitled Document</title>
<style type="text/css">
#bar {
  font-size: 12px;
  color: #FF6D26;
  background-position: 25px center;
  text-indent: 0px;
  background-repeat: no-repeat;
  line-height: 30px;
  
}  
#demo {
  overflow:hidden;
  height:200px;
  width:500px;
  white-space:nowrap;
  
}
#demo ul{display:inline;margin:0px}
#demo li{display:inline}
#demo a{display:inline; display:inline-block!important; width:150px; text-align:center; margin:5px;}

</style>
</head>

<body>
<!--公告条-->
<div id="bar">
  <div id="demo">

  <ul id="demo1">
    
  
            <li>
            泉州安捷集装箱运输有限公司,专业从事国内<br />
      海运、陆运、铁运等运输服务,</li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li>竭诚为客户提供货物相关物</li>
            <li></li>
            <li><br />
              流服务,包括海运订舱、集装箱拖运及送货等服务。
              
              我司地处<br />
              中国海西物流主要聚散地—泉州,毗邻石狮石湖港、金井围头<br />
              港及后渚港等多个码头、我司与各大船东、码头、集装箱运输<br />
              公司等有着多年的合作友谊,籍此,我们竭诚为客户提供更加<br />
              快捷、便利、周到的操作服务,真正实现物流“一站式”服务,免<br />
              除客户繁锁的物流工作负担,为客户提供更加优惠的价格,针对不<br />
              同的出货要求,我们可为客户提供量身定做个性化的物流方案。
              
              我司<br />
              主要经营的航线:泉州—营口、天津、烟台、青岛、日照、连云港、南京<br />
              、南通、上海、乍浦、宁波、黄埔、南宁、海口、昆明及各港口返程航线<br />
              。
              
              我司友好合作的船东:中海、安通、新闽行、中远、南青、江苏中外运、<br />
              港通、明发、恒瑞、福海、星航、和易等等;
              
              
              
              我司友好合作的陆运车队:闽顺<br />
              达、宁波港集装箱运输、恒华物流、九丰物流、金城物流、创元物流、大丰基<br />
              物流、鄞州物流等。 </li>
      
          
  
  </ul>

  <ul id="demo2"></ul>

<script>


var speed=5

document.getElementById("demo2").innerHTML=document.getElementById("demo1").innerHTML

function Marquee(){

if(document.getElementById("demo2").offsetHeight-document.getElementById("demo").scrollTop<=0)

document.getElementById("demo").offsetHeight-=document.getElementById("demo1").offsetHeight

else{

document.getElementById("demo").scrollTop++

}

}

var MyMar=setInterval(Marquee,speed)

document.getElementById("demo").onmouseover=function() {clearInterval(MyMar)}

document.getElementById("demo").onmouseout=function() {MyMar=setInterval(Marquee,speed)}



</script></div></div>

<!--公告条结束-->
</body>
</html>
[/hcode]
Tags:
Add a comment

Nickname

Site URI

Email

Enable HTML Enable UBB Enable Emots Hidden Remember [Login] [Register]