jQuery類比360瀏覽器切屏效果投影片(附demo源碼下載),jquerydemo

來源:互聯網
上載者:User

jQuery類比360瀏覽器切屏效果投影片(附demo源碼下載),jquerydemo

本文執行個體講述了jQuery類比360瀏覽器切屏效果投影片,分享給大家供大家參考,具體如下:

運行效果如下:

點擊此處查看線上示範效果。

具體代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>  <title>360效果投影片</title>  <script src="jquery-1.7.2.min.js" type="text/javascript"></script>  <script type="text/javascript" >    function changeDesktopBg(index) {      $("#desktopList").animate({"margin-left": -(index*1000)+"px", "speed": 2000});    }  </script>  <style type="text/css" >    body { margin:0; padding: 0;}    #desktop ul { padding:0; border-bottom-style:none; width:5000px; list-style:none; }    #desktop li { padding:0; float:left;}    .desktop_li_img { width:1000px; height:600px;}    #desktop { width:1000px; overflow:hidden; height:600px;}    #controller ul { width:250px; list-style:none;}    #controller li { width:40px; float:left; padding:0; text-align:center; margin-left:5px; }    .controller_li_block { background:#F2F2F2; height:10px; line-height:10px; border:2px solid gray; cursor:pointer;}  </style></head><body><center>  <div id="desktop">    <ul id="desktopList">      <li><img src="img/1.jpg" class="desktop_li_img" alt="屏1" /></li>      <li><img src="img/2.jpg" class="desktop_li_img" alt="屏1" /></li>      <li><img src="img/3.jpg" class="desktop_li_img" alt="屏1" /></li>      <li><img src="img/4.jpg" class="desktop_li_img" alt="屏1" /></li>      <li><img src="img/5.jpg" class="desktop_li_img" alt="屏1" /></li>    </ul>  </div>  <div id="controller">    <ul >      <li><div class="controller_li_block" onclick="changeDesktopBg(0)">1</div></li>      <li><div class="controller_li_block" onclick="changeDesktopBg(1)">2</div></li>      <li><div class="controller_li_block" onclick="changeDesktopBg(2)">3</div></li>      <li><div class="controller_li_block" onclick="changeDesktopBg(3)">4</div></li>      <li><div class="controller_li_block" onclick="changeDesktopBg(4)">5</div></li>    </ul>  </div></center></body></html>

完整執行個體代碼點擊此處本站下載。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.