本文實例講述了jquery外掛程式bxslider用法。分享給大家供大家參考。具體用法如下:
先呼叫對應js檔:
<script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/jquery.bxslider.js"></script>
jQuery程式碼部分:
$(function(){ $('#marquee').bxSlider({ mode:'vertical', //默认的是水平 displaySlideQty:1,//显示li的个数 moveSlideQty: 1,//移动li的个数 captions: true,//自动控制 auto: true, controls: false//隐藏左右按钮 }); });
HTML結構如下:
<div style="width:450px; height:296px; float:left; overflow:hidden; margin-left:200px;"> <ul id="marquee"> <li> <img src="/static/imghwm/default1.png" data-src="img/1.jpg" class="lazy" alt="banner_美容" style="width:450px; height:296px;"> </li> <li> <img src="/static/imghwm/default1.png" data-src="img/2.jpg" class="lazy" alt="banner_美容" style="width:450px; height:296px;"> </li> </ul> </div>
CSS定義左右按鈕樣式:
.bx-prev{ width:12px; height:26px; background:#f00;text-indent: -999999px;z-index: 999; position: absolute; float:left; left:455px; top:110px; } .bx-next{ width:12px; height:26px; background:#f00; text-indent: -999999px; z-index: 999; position: absolute; top:110px;left:-15px; }
參數說明:
bxSlider 詳細設定參數:
bxSlider有很多設定參數,讓你能夠用參數製作出各種各樣的slider效果:
mode: 'horizontal', // 'horizontal', 'vertical', 'fade' 定義slider滾動的方向,有三個值可供選擇
infiniteLoop: true, // true, false - display first slide after last 無限迴圈
hideControlOnEnd: false, // true, false - if true, will hide 'next' control on last slide and 'prev' control on first 如果設定true,將會在最後一個幻燈片隱藏“next”,在最前面的幻燈片因此「prev」
controls: true, // true, false - previous and next controls 是否顯示「previous」和「next」按鈕
speed: 500, // integer - in ms, duration of time slide transitions will occupy 速度,單位為毫秒
easing: 'swing', // used with jquery.easing.1.3.js - see http://gsgd.co.uk/sandbox/jquery/easing/ for available options
pager: true, // true / false - display a pager
pagerSelector: null, // jQuery selector - element to contain the pager. ex: '#pager'
pagerType: 'full', // 'full', 'short' - if 'full' pager displays 1,2,3... if 'short' pager displays 1 / 4 若設定full,將顯示1,2,3 ……,如果設定short,將顯示1/4 .
pagerLocation: 'bottom', // 'bottom', 'top' - location of pager 頁碼的位置
pagerShortSeparator: '/', // string - ex: 'of' pager would display 1 of 4 頁面分隔符號
pagerActiveClass: 'pager-active', // string - classname attached to the active pager link 目前頁碼的className
nextText: 'next', // string - text displayed for 'next' control 下一頁的文字
nextImage: '', // string - filepath of image used for 'next' control. ex: 'images/next.jpg' 可以設定下一頁為圖片
nextSelector: null, // jQuery selector - element to contain the next control. ex: '#next'
prevText: 'prev', // string - text displayed for 'previous' control 上一頁的文字
prevImage: '', // string - filepath of image used for 'previous' control. ex: 'images/prev.jpg' 上一頁的圖片
prevSelector: null, // jQuery selector - element to contain the previous control. ex: '#next'
captions: false, // true, false - display image captions (reads the image 'title' tag) 是否顯示圖片的標題,讀取圖片的title屬性的內容。
captionsSelector: null, // jQuery selector - element to contain the captions. ex: '#captions'
auto: false, // true, false - make slideshow change automatically 投影片自動捲動
autoDirection: 'next', // 'next', 'prev' - direction in which auto show will traverse 自動滾動的順序
autoControls: false, // true, false - show 'start' and 'stop' controls for auto show 自動捲動的控制鍵
autoControlsSelector: null, // jQuery selector - element to contain the auto controls. ex: '#auto-controls'
autoStart: true, // true, false - if false show will wait for 'start' control to activate
autoHover: false, // true, false - if true show will pause on mouseover 設定滑鼠mouseover將會使自動捲動暫停
autoDelay: 0, // integer - in ms, the amount of time before starting the auto show
pause: 3000, // integer - in ms, the duration between each slide transition 過渡時間
startText: 'start', // string - text displayed for 'start' control 開始按鈕的文字
startImage: '', // string - filepath of image used for 'start' control. ex: 'images/start.jpg' 開始按鈕的圖片
stopText: 'stop', // string - text displayed for 'stop' control 停止按鈕的文字
stopImage: '', // string - filepath of image used for 'stop' control. ex: 'images/stop.jpg' 停止按鈕的圖片
ticker: false, // true, false - continuous motion ticker mode (think news ticker)
// note: autoControls and autoControlsSelector apply to ticker!
tickerSpeed: 5000, // integer - has an inverse effect on speed. therefore, a value of 10000 will
// scroll very slowly while a value of 50 will scroll very quickly.
tickerDirection: 'next', // 'next', 'prev' - direction in which ticker show will traverse
tickerHover: false, // true, false - if true ticker will pause on mouseover
wrapperClass: 'bx-wrapper', // string - classname attached to the slider wraper
startingSlide: 0, // integer - show will start on specified slide. note: slides are zero based!
displaySlideQty: 1, // integer - number of slides to display at once
moveSlideQty: 1, // integer - number of slides to move at once
randomStart: false, // true, false - if true show will start on a random slide
希望本文所述對大家的jQuery程式設計有所幫助。

javaandjavascriptaredistinctlanguages:javaisusedforenterpriseandmobileapps,while javascriptifforInteractiveWebpages.1)JavaisComcompoppored,statieldinglationallyTypted,statilly tater astrunsonjvm.2)

JavaScript核心數據類型在瀏覽器和Node.js中一致,但處理方式和額外類型有所不同。 1)全局對像在瀏覽器中為window,在Node.js中為global。 2)Node.js獨有Buffer對象,用於處理二進制數據。 3)性能和時間處理在兩者間也有差異,需根據環境調整代碼。

JavaScriptusestwotypesofcomments:single-line(//)andmulti-line(//).1)Use//forquicknotesorsingle-lineexplanations.2)Use//forlongerexplanationsorcommentingoutblocksofcode.Commentsshouldexplainthe'why',notthe'what',andbeplacedabovetherelevantcodeforclari

Python和JavaScript的主要區別在於類型系統和應用場景。 1.Python使用動態類型,適合科學計算和數據分析。 2.JavaScript採用弱類型,廣泛用於前端和全棧開發。兩者在異步編程和性能優化上各有優勢,選擇時應根據項目需求決定。

選擇Python還是JavaScript取決於項目類型:1)數據科學和自動化任務選擇Python;2)前端和全棧開發選擇JavaScript。 Python因其在數據處理和自動化方面的強大庫而備受青睞,而JavaScript則因其在網頁交互和全棧開發中的優勢而不可或缺。

Python和JavaScript各有優勢,選擇取決於項目需求和個人偏好。 1.Python易學,語法簡潔,適用於數據科學和後端開發,但執行速度較慢。 2.JavaScript在前端開發中無處不在,異步編程能力強,Node.js使其適用於全棧開發,但語法可能複雜且易出錯。

javascriptisnotbuiltoncorc; sanInterpretedlanguagethatrunsonenginesoftenwritteninc.1)JavascriptwasdesignedAsignedAsalightWeight,drackendedlanguageforwebbrowsers.2)Enginesevolvedfromsimpleterterpretpretpretpretpreterterpretpretpretpretpretpretpretpretpretcompilerers,典型地,替代品。

JavaScript可用於前端和後端開發。前端通過DOM操作增強用戶體驗,後端通過Node.js處理服務器任務。 1.前端示例:改變網頁文本內容。 2.後端示例:創建Node.js服務器。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

ZendStudio 13.5.1 Mac
強大的PHP整合開發環境

SecLists
SecLists是最終安全測試人員的伙伴。它是一個包含各種類型清單的集合,這些清單在安全評估過程中經常使用,而且都在一個地方。 SecLists透過方便地提供安全測試人員可能需要的所有列表,幫助提高安全測試的效率和生產力。清單類型包括使用者名稱、密碼、URL、模糊測試有效載荷、敏感資料模式、Web shell等等。測試人員只需將此儲存庫拉到新的測試機上,他就可以存取所需的每種類型的清單。

Atom編輯器mac版下載
最受歡迎的的開源編輯器

MinGW - Minimalist GNU for Windows
這個專案正在遷移到osdn.net/projects/mingw的過程中,你可以繼續在那裡關注我們。 MinGW:GNU編譯器集合(GCC)的本機Windows移植版本,可自由分發的導入函式庫和用於建置本機Windows應用程式的頭檔;包括對MSVC執行時間的擴展,以支援C99功能。 MinGW的所有軟體都可以在64位元Windows平台上運作。

MantisBT
Mantis是一個易於部署的基於Web的缺陷追蹤工具,用於幫助產品缺陷追蹤。它需要PHP、MySQL和一個Web伺服器。請查看我們的演示和託管服務。