本文實例講述了jQuery實作標題有打字效果的焦點圖程式碼。分享給大家參考,具體如下:
為大家分享一個基於jQuery標題有打字效果的焦點圖,具有標題打字形式逐漸顯示的功能。這款焦點圖適用瀏覽器有:IE8、360、FireFox、Chrome、Safari、Opera、傲遊、搜狗、世界之窗。
運作效果截圖如下:
線上示範網址如下:
http://demo.jb51.net/js/2015/jquery-title-print-style-flash-codes/
完整實例代碼代碼點擊此處本站下載。
html程式碼如下:
<!-- 代码 开始 --> <div id="header"> <div class="wrap"> <div id="slide-holder"> <div id="slide-runner"> <a href="#" target="_blank"> <img id="slide-img-1" src="images/a1.jpg" class="slide" alt="" /></a> <a href="#" target="_blank"> <img id="slide-img-2" src="images/a2.jpg" class="slide" alt="" /></a> <a href="#" target="_blank"> <img id="slide-img-3" src="images/a3.jpg" class="slide" alt="" /></a> <a href="#" target="_blank"> <img id="slide-img-4" src="images/a4.jpg" class="slide" alt="" /></a> <a href="#" target="_blank"> <img id="slide-img-5" src="images/a5.jpg" class="slide" alt="" /></a> <a href="#" target="_blank"> <img id="slide-img-6" src="images/a6.jpg" class="slide" alt="" /></a> <a href="#" target="_blank"> <img id="slide-img-7" src="images/a4.jpg" class="slide" alt="" /></a> <div id="slide-controls"> <p id="slide-client" class="text"> <strong></strong><span></span> </p> <p id="slide-desc" class="text"> </p> <p id="slide-nav"> </p> </div> </div> </div>
js程式碼如下:
if (!window.slider) { var slider = {}; } slider.data = [ { "id": "slide-img-1", // 与slide-runner中的img标签id对应 "client": "标题1", "desc": "这里修改描述 这里修改描述 这里修改描述" //这里修改描述 }, { "id": "slide-img-2", "client": "标题2", "desc": "add your description here" }, { "id": "slide-img-3", "client": "标题3", "desc": "add your description here" }, { "id": "slide-img-4", "client": "标题4", "desc": "add your description here" }, { "id": "slide-img-5", "client": "标题5", "desc": "add your description here" }, { "id": "slide-img-6", "client": "标题6", "desc": "add your description here" }, { "id": "slide-img-7", "client": "标题7", "desc": "add your description here" } ];
希望本文所述對大家jQuery程式設計有所幫助。