基於JSON格式資料的簡單jQuery投影片外掛(jquery-slider)的介紹
這篇文章主要介紹了關於基於JSON格式資料的簡單jQuery投影片外掛程式(jquery-slider)的介紹,有著一定的參考價值,現在分享給大家,有需要的朋友可以參考一下
jquery-slider幻燈片插件透過json資料來提供圖片地址和描述信息,同時也可以更換json數據來動態切換不同的圖片,對json數據jquery幻燈片插件相關知識感興趣的朋友一起學習吧
jquery-slider是一款基於JSON格式資料的jQuery投影片外掛程式。這張投影片透過JSON資料來提供圖片地址和描述資訊等,你可以透過更換JSON資料來動態切換不同的圖片。
使用方法
#在頁面中引入jquery和slider.js檔案和font-awesome字體圖示檔案。
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css'> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/slider.js"></script>
HTML結構
使用
作為投影片的容器,裡面放置作為前後導航按鈕的
<p class="slider" id="slider"> <button type="button" class="button button-prev"> <i class="fa fa-chevron-left" aria-hidden="true"></i> </button> <button type="button" class="button button-next"> <i class="fa fa-chevron-right" aria-hidden="true"></i> </button> </p>
CSS樣式
為投影片設定下面的CSS樣式。
.slider { width: 100%; overflow: hidden; height: 500px; position: relative; } .sliderList { position: absolute; top: 0; width: 300%; height: 100%; list-style: none; } .sliderList li { position: absolute; top: 0; bottom: 0; overflow: hidden; width: 33.333333%; height: 100%; padding: 0; margin: 0; } .sliderList li img { width: 100%; min-height: 100%; border: none; } .bulletList { position: absolute; bottom: 15px; width: 100%; margin: 0 auto; list-style: none; } .bulletList li { display: inline-block; width: 12px; height: 12px; margin: 0 5px; -webkit-border-radius: 50%; -moz-border-radius: 50%; -ms-border-radius: 50%; border-radius: 50%; background-color: #fff; cursor: pointer; } .bulletList .bulletActive { background-color: #0b0d18; } .content { position: absolute; top: 0; left: 0; right: 0; background-color: rgba(0, 0, 0, 0.3); font-size: 48px; color: #fff; } .button { position: absolute; bottom: 15px; z-index: 2; display: block; width: 40px; height: 40px; box-sizing: border-box; margin: 0; padding: 0; border: none; -webkit-border-radius: 5px; -moz-border-radius: 5px; -ms-border-radius: 5px; border-radius: 5px; background-color: rgba(5, 0, 36, 0.6); color: #fff; } .button-prev { left: 15px; } .button-next { right: 15px; }
JSON資料
該投影片的圖片和圖片描述資訊有JSON資料來提供,格式如下:
sliderJSON = [ { "imagePath": "1.jpg", "order": "2", "url": "#", "slideText": "图片描述" }, { "imagePath": "2.jpg", "order": "3", "url": "#", "slideText": "图片描述" }, { "imagePath": "3.jpg", "order": "1", "url": "#", "slideText": "图片描述" }, { "imagePath": "4.jpg", "order": "4", "url": "#", "slideText": "图片描述" }
jquery-slider投影片外掛程式的github位址為:https://github.com/eryasov/jquery-slider
以上就是本文的全部內容,希望對大家的學習有所幫助,更多相關內容請關注PHP中文網!
相關推薦:
關於jquery ajaxfileuplod 上傳檔案essyui laoding的效果
#
以上是基於JSON格式資料的簡單jQuery投影片外掛(jquery-slider)的介紹的詳細內容。更多資訊請關注PHP中文網其他相關文章!

熱AI工具

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

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

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

熱門話題

本文討論了在瀏覽器中優化JavaScript性能的策略,重點是減少執行時間並最大程度地減少對頁面負載速度的影響。

本文討論了使用瀏覽器開發人員工具的有效JavaScript調試,專注於設置斷點,使用控制台和分析性能。

Python和JavaScript開發者的薪資沒有絕對的高低,具體取決於技能和行業需求。 1.Python在數據科學和機器學習領域可能薪資更高。 2.JavaScript在前端和全棧開發中需求大,薪資也可觀。 3.影響因素包括經驗、地理位置、公司規模和特定技能。

本文說明瞭如何使用源地圖通過將其映射回原始代碼來調試JAVASCRIPT。它討論了啟用源地圖,設置斷點以及使用Chrome DevTools和WebPack之類的工具。

如何在JavaScript中將具有相同ID的數組元素合併到一個對像中?在處理數據時,我們常常會遇到需要將具有相同ID�...

深入探討console.log輸出差異的根源本文將分析一段代碼中console.log函數輸出結果的差異,並解釋其背後的原因。 �...
