marquee元素怎么實現(xiàn)滾動字體與圖片的效果?這個問題可能是我們?nèi)粘W習或工作經(jīng)常見到的。希望通過這個問題能讓你收獲頗深。下面是小編給大家?guī)淼膮⒖純?nèi)容,讓我們一起來看看吧!
創(chuàng)新互聯(lián)建站專業(yè)為企業(yè)提供樂平網(wǎng)站建設(shè)、樂平做網(wǎng)站、樂平網(wǎng)站設(shè)計、樂平網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計與制作、樂平企業(yè)網(wǎng)站模板建站服務,十多年樂平做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡服務。
marquee元素可以實現(xiàn)簡單的字體(圖片等)的滑動等效果:
<style type="text/css"> #div01{ width: 500px; } </style> <script type="text/javascript"> </script> <marquee behavior="alertnate"><font size=30 color='red'>www.baidu.com111</font></marquee> <marquee direction=right bgcolor='#ff2233' behavior="alertnate"><font size=30 color='blue'>www.baidu.com222</font></marquee> <marquee id="m3" direction=down bgcolor='#dbdbdb' height=50px hspace=20px vspace=20px behavior="alertnate" scrollLeft=left onmouseover="this.stop()" onmouseout="this.start()"><font size=30 color='blue'>www.baidu333.com</font></marquee> <marquee id="m4" direction=up bgcolor='#00dbdb' behavior="alertnate"><font size=30 color='blue'>www.baidu444.com</font></marquee>
<div id="div01"><marquee direction=right bgcolor='#ff2233' behavior="alertnate" scrolldelay=100><font size=30 color='blue'>www.baidu.com555</font></marquee></div> <input type="button" onclick="m3.stop();" value="m3.stop"></input> <input type="button" onclick="m3.start();" value="m3.start"></input> <button onclick="m4.stop();">m4.stop</button> <button onclick="m4.start();">m4.start</button>
direction 表示滾動的方向,值可以是left,right,up,down,默認為left
behavior 表示滾動的方式,值可以是scroll(連續(xù)滾動)slide(滑動一次)alternate(來回滾動)
loop 表示循環(huán)的次數(shù),值是正整數(shù),默認為無限循環(huán)
scrollamount 表示運動速度,值是正整數(shù),默認為6
scrolldelay 表示停頓時間,值是正整數(shù),默認為0,單位似乎是毫秒
align 表示元素的垂直對齊方式,值可以是top,middle,bottom,默認為middle
bgcolor 表示運動區(qū)域的背景色,值是16進制的RGB顏色,默認為白色
height、width 表示運動區(qū)域的高度和寬度,值是正整數(shù)(單位是像素)或百分數(shù),默認width=100% height為標簽內(nèi)元素的高度
hspace、vspace 表示元素到區(qū)域邊界的水平距離和垂直距離,值是正整數(shù),單位是像素。
onmouseover=this.stop() onmouseout=this.start() 表示當鼠標以上區(qū)域的時候滾動停止,當鼠標移開的時候又繼續(xù)滾動。
以下是設(shè)置點擊按鈕時m3、m4的滾動或停止:
<input type="button" onclick="m3.stop();" value="m3.stop"></input> <input type="button" onclick="m3.start();" value="m3.start"></input> <button onclick="m4.stop();">m4.stop</button> <button onclick="m4.start();">m4.start</button>
感謝各位的閱讀!看完上述內(nèi)容,你們對marquee元素怎么實現(xiàn)滾動字體與圖片的效果大概了解了嗎?希望文章內(nèi)容對大家有所幫助。如果想了解更多相關(guān)文章內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
新聞名稱:marquee元素怎么實現(xiàn)滾動字體與圖片的效果
本文路徑:http://aaarwkj.com/article10/jjhodo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站導航、虛擬主機、建站公司、網(wǎng)頁設(shè)計公司、企業(yè)網(wǎng)站制作、網(wǎng)站維護
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)