JQuery插件Marquee.js實現(xiàn)無縫滾動效果
更新時間:2016年04月26日 10:50:23 作者:零度anngle
這篇文章主要介紹了JQuery插件Marquee.js實現(xiàn)無縫滾動效果的相關資料,需要的朋友可以參考下
Marquee.js插件提供了許多屬性選項,您可以配置定制外觀和效果。
{ yScroll: "top" // 初始滾動方向 (還可以是"top" 或 "bottom") showSpeed: 850 // 初始下拉速度 scrollSpeed: 12 // 滾動速度 , pauseSpeed: 5000 // 滾動完到下一條的間隔時間 pauseOnHover: true // 鼠標滑向文字時是否停止?jié)L動 loop: -1 // 設置循環(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 // 當新的滾動內(nèi)容顯示時回調(diào)函數(shù) aftershow: null // 滾動完了回調(diào)函數(shù) }
詳細代碼:
<!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, // 鼠標滑向文字時是否停止?jié)L動 , loop: -1 , // 設置循環(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)設計</a> [2011-09-20]</li> <li><a href="#" target="_blank">系統(tǒng)運維</a> [2011-10-16]</li> </ul> </body> </html>
以上就是本文的全部內(nèi)容,希望對大家學習jquery程序設計有所幫助。
相關文章
jQuery實現(xiàn)的響應鼠標移動方向插件用法示例【附源碼下載】
這篇文章主要介紹了jQuery實現(xiàn)的響應鼠標移動方向插件用法,涉及jQuery響應鼠標事件及頁面元素屬性動態(tài)操作相關實現(xiàn)技巧,需要的朋友可以參考下2018-08-08jquery blockUI 遮罩不能消失與不能提交的解決方法
jquery blockUI 遮罩不能消失與不能提交的解決方法,使用jquery blockUI的朋友可以參考下。2011-09-09