js向上無縫滾動,網(wǎng)站公告效果 具體代碼
<!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>無標(biāo)題文檔</title>
<style type="text/css">
<!
-- #demo
{
overflow: hidden;
width: 220px;
float: left;
display: inline;
}
#demo ul
{
text-align: left;
margin: 0px;
padding: 0px;
width: 220px;
}
#demo ul li
{
margin-left: 5px;
display: block;
list-style: none;
font-size: 13px;
height: 26px;
padding-top: 5px;
}
-- ></style>
</head>
<body>
//這里的高度 style="height: 26px如果不確定的話,需要自定義輸入,要不然如果定義高了而ul里的li沒達(dá)到此高度會造成無法滾動
<div id="demo" style="height: 26px;">
<div id="demo1">
<ul>
<li>·<a href="http://www.dbjr.com.cn/">腳本之家1</a></li>
<li>·<a href="http://www.dbjr.com.cn/">腳本之家2</a></li>
<li>·<a href="http://www.dbjr.com.cn/">腳本之家3</a></li>
<li>·<a href="http://www.dbjr.com.cn/">腳本之家4</a></li>
</ul>
</div>
<div id="demo2">
</div>
<script type="text/javascript">
//文字無間斷滾動代碼,兼容IE、Firefox、Opera
var speed=60;
var FGDemo=document.getElementById('demo');
var FGDemo1=document.getElementById('demo1');
var FGDemo2=document.getElementById('demo2');
FGDemo2.innerHTML=FGDemo1.innerHTML
function Marquee1(){
if(FGDemo2.offsetHeight-FGDemo.scrollTop<=0)
FGDemo.scrollTop-=FGDemo1.offsetHeight
else{
FGDemo.scrollTop++
}
}
var MyMar1=setInterval(Marquee1,speed)
FGDemo.onmouseover=function() {clearInterval(MyMar1)}
FGDemo.onmouseout=function() {MyMar1=setInterval(Marquee1,speed)}
</script>
</div>
</body>
</html>
- js實(shí)現(xiàn)圖片無縫滾動特效
- 徹底搞懂JS無縫滾動代碼
- div+css+js實(shí)現(xiàn)無縫滾動類似marquee無縫滾動兼容firefox
- js 實(shí)現(xiàn)無縫滾動 兼容IE和FF
- jcarousellite.js 基于Jquery的圖片無縫滾動插件
- javascript實(shí)現(xiàn)的左右無縫滾動效果
- js實(shí)現(xiàn)可控制左右方向的無縫滾動效果
- js實(shí)現(xiàn)文字列表無縫滾動效果
- JQuery插件Marquee.js實(shí)現(xiàn)無縫滾動效果
- JavaScript定時器實(shí)現(xiàn)無縫滾動圖片
相關(guān)文章
比較詳細(xì)的關(guān)于javascript中void(0)的具體含義解釋
比較詳細(xì)的關(guān)于javascript中void(0)的具體含義解釋...2007-08-08淺談js之字面量、對象字面量的訪問、關(guān)鍵字in的用法
下面小編就為大家?guī)硪黄獪\談js之字面量、對象字面量的訪問、關(guān)鍵字in的用法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-11-11javascript中驗(yàn)證大寫字母、數(shù)字和中文
本文為大家介紹下使用javascript驗(yàn)證大寫字母小寫字母,數(shù)字和中文,具體示例如下2014-01-01