JQuery插件Marquee.js實(shí)現(xiàn)無縫滾動效果
更新時間:2016年04月26日 10:50:23 作者:零度anngle
這篇文章主要介紹了JQuery插件Marquee.js實(shí)現(xiàn)無縫滾動效果的相關(guān)資料,需要的朋友可以參考下
Marquee.js插件提供了許多屬性選項(xiàng),您可以配置定制外觀和效果。
{ yScroll: "top" // 初始滾動方向 (還可以是"top" 或 "bottom") showSpeed: 850 // 初始下拉速度 scrollSpeed: 12 // 滾動速度 , pauseSpeed: 5000 // 滾動完到下一條的間隔時間 pauseOnHover: true // 鼠標(biāo)滑向文字時是否停止?jié)L動 loop: -1 // 設(shè)置循環(huán)滾動次數(shù) (-1為無限循環(huán)) fxEasingShow: "swing" // 緩沖效果 fxEasingScroll: "linear" // 緩沖效果 cssShowing: "marquee-showing" //定義class // event handlers init: null // 初始調(diào)用函數(shù) beforeshow: null // 滾動前回調(diào)函數(shù) show: null // 當(dāng)新的滾動內(nèi)容顯示時回調(diào)函數(shù) aftershow: null // 滾動完了回調(diào)函數(shù) }
詳細(xì)代碼:
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>marquee測試</title> <script type="text/javascript" src="../../jquery/jquery.js"></script> <script type="text/javascript" src="../marquee/lib/jquery.marquee.js"></script> <script type="text/javascript"> $(function(){ $("#marquee").marquee({ yScroll: "bottom", showSpeed: 850, // 初始下拉速度 , scrollSpeed: 12, // 滾動速度 , pauseSpeed: 500, // 滾動完到下一條的間隔時間 , pauseOnHover: true, // 鼠標(biāo)滑向文字時是否停止?jié)L動 , loop: -1 , // 設(shè)置循環(huán)滾動次數(shù) (-1為無限循環(huán)) , fxEasingShow: "swing" , // 緩沖效果 , fxEasingScroll: "linear", // 緩沖效果 , cssShowing: "marquee-showing" //定義class }); }); </script> <style> ul.marquee { display: block; line-height: 1; position: relative; overflow: hidden; width: 400px; height: 22px; } ul.marquee li { position: absolute; top: -999em; left: 0; display: block; white-space: nowrap; padding: 3px 5px; text-indent:0.8em } </style> </head> <body > <ul id="marquee" class="marquee"> <li><a href="#" target="_blank">WEB前端開發(fā)</a> [2011-10-20]</li> <li><a href="#" target="_blank">架構(gòu)設(shè)計</a> [2011-09-20]</li> <li><a href="#" target="_blank">系統(tǒng)運(yùn)維</a> [2011-10-16]</li> </ul> </body> </html>
以上就是本文的全部內(nèi)容,希望對大家學(xué)習(xí)jquery程序設(shè)計有所幫助。
您可能感興趣的文章:
相關(guān)文章
jQuery實(shí)現(xiàn)判斷控件是否顯示的方法
這篇文章主要介紹了jQuery實(shí)現(xiàn)判斷控件是否顯示的方法,涉及jQuery針對頁面元素屬性相關(guān)操作技巧,需要的朋友可以參考下2017-01-01jQuery實(shí)現(xiàn)的響應(yīng)鼠標(biāo)移動方向插件用法示例【附源碼下載】
這篇文章主要介紹了jQuery實(shí)現(xiàn)的響應(yīng)鼠標(biāo)移動方向插件用法,涉及jQuery響應(yīng)鼠標(biāo)事件及頁面元素屬性動態(tài)操作相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2018-08-08jquery blockUI 遮罩不能消失與不能提交的解決方法
jquery blockUI 遮罩不能消失與不能提交的解決方法,使用jquery blockUI的朋友可以參考下。2011-09-09jQuery validata插件實(shí)現(xiàn)方法
下面小編就為大家?guī)硪黄猨Query validata插件實(shí)現(xiàn)方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-06-06