欧美国产另类久热|951超碰伊人久久|伊人影视久久久久|色婷婷亚洲小电影|色东京热69XX|婷婷玖玖深爱网|加勒比东京热网站|无码A级毛片在线观看|一级a毛一级a看|中文字幕人妻欧美

html借助marquee實現(xiàn)文字左右滾動
來源:易賢網 閱讀:1179 次 日期:2016-06-16 09:13:31
溫馨提示:易賢網小編為您整理了“html借助marquee實現(xiàn)文字左右滾動”,方便廣大網友查閱!

代碼如下:

<body>

//借助于marquee

<marquee behavior=scroll contenteditable=true onstart=this.firstchild.innerhtml+=this.firstchild.innerhtml; scrollamount=3 width=100>

<span unselectable=on>這里是要滾動的內容</span>

</marquee>

//普通的實現(xiàn)方法

<div id=scrollobj style=white-space:nowrap;overflow:hidden;width:500px;>

<span>這里是要滾動的內容</span>

</div>

<script language=javascript type=text/javascript>

function scroll(obj) {

var tmp = (obj.scrollleft)++;

//當滾動條到達右邊頂端時

if (obj.scrollleft==tmp) obj.innerhtml += obj.innerhtml;

//當滾動條滾動了初始內容的寬度時滾動條回到最左端

if (obj.scrollleft>=obj.firstchild.offsetwidth) obj.scrollleft=0;

}

setinterval(scroll(document.getelementbyid('scrollobj')),20);

</script>

</body>

更多信息請查看網頁制作
關于我們 | 聯(lián)系我們 | 人才招聘 | 網站聲明 | 網站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點

版權所有:易賢網