轉:大氣炫酷焦點輪播圖js特效

來源:互聯網
上載者:User

標籤:高度   提示   標籤   位置   刪除   txt   ima   att   情況   

使用方法

Step 1. 在html的標籤內引入相關檔案

<script type="text/javascript" src="js/myfocus-2.0.0.min.js"></script><!--引入myFocus庫--><script type="text/javascript" src="js/mf-pattern/slide3D.js"></script><!--引入風格js檔案--><link href="js/mf-pattern/slide3D.css" type="text/css" /><!--引入風格css檔案-->

提示:合格情況下,引入風格檔案(js/css)可省,引入myFocus庫即可。那麼風格檔案是如何自動引入的?詳情請看myFocus的檔案結構與自動引入風格檔案機制。

Step 2. 建立myFocus標準的html結構,並填充你的內容

<div id="boxID"><!--焦點圖盒子-->  <div class="loading"><img src="img/loading.gif" alt="請稍候..." /></div><!--載入畫面(可刪除)-->  <div class="pic"><!--內容列表(li數目可隨意增減)-->  <ul>        <li><a href="#"><img src="img/1.jpg" thumb="" alt="標題1" text="詳細描述1" /></a></li>        <li><a href="#"><img src="img/2.jpg" thumb="" alt="標題2" text="詳細描述2" /></a></li>        <li><a href="#"><img src="img/3.jpg" thumb="" alt="標題3" text="詳細描述3" /></a></li>        <li><a href="#"><img src="img/4.jpg" thumb="" alt="標題4" text="詳細描述4" /></a></li>        <li><a href="#"><img src="img/5.jpg" thumb="" alt="標題5" text="詳細描述5" /></a></li>  </ul>  </div></div>

IMG標籤的屬性說明:

Step 3. 在step1代碼之後的任意一個位置調用(建議在head標籤結束前調用)

//你可以簡單的調用---只設定它的盒子id,其它參數全部預設設定:

<script type="text/javascript">    myFocus.set({id:‘boxID‘});</script>

//或詳細一點的參數調用:

<script type="text/javascript">myFocus.set({id:‘boxID‘,//焦點圖盒子ID     
pattern:‘mF_fancy‘,//風格應用的名稱     
time:3,//切換時間間隔(秒)     
trigger:‘click‘,//觸發切換模式:‘click‘(點擊)/‘mouseover‘(懸停)     
width:450,//設定圖片地區寬度(像素)     
height:296,//設定圖片地區高度(像素)     
txtHeight:‘default‘//文字層高度設定(像素),‘default‘為預設高度,0為隱藏 });</script>

 

轉:大氣炫酷焦點輪播圖js特效

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.