開發路程(14):背景圖片移動外掛程式MyFloatingBg(浮動背景圖效果,可讓背景隨著頁面的滾動而滾動)

來源:互聯網
上載者:User

標籤:des   style   blog   http   java   color   使用   os   

MyFloatingBg這外掛程式可以協助你在網頁上加入可移動背景Background。你可以用於整個檔案的背景,或是某幾個banner的背景。 它可支援簡單的animation效果,你不用去做一個flash檔案或動態gif圖片。單靠jquery和圖片,你便可以做出不同的效果。由於我們把動畫效果跟內容分開,我們也可以隨時更改文字等內容,而不影響其運作。這個效果很是大氣,我想可以使用在進階餐廳,珠寶展會等中做展示用.

 1 <!doctype html> 2 <html lang="en"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <title></title> 6 <script type="text/javascript" src="js/jquery.js"></script> 7 <script type="text/javascript" src="js/jquery.MyFloatingBg.js"></script> 8 <script type="text/javascript"> 9 $(document).ready(function(){10   11     $("#demoDiv1").MyFloatingBg({direction:-1});12     13 });14 </script>15 16 <style type="text/css">17 body { margin: 0px; }18   .m{ height: 740px; 19     text-align: center; 20     font-family: 微軟雅黑, Arial, Helvetica, sans-serif; 21     font-weight: bold; 22     font-size: 36px; 23     line-height: 740px; 24     }25 </style>26 </head>27 28 <body>29 30 31 <div id="demoDiv1" bg="img/fw2.png" class="m">32   <div style="color:rgba(222,222,222,0.4)!important;">33       歡迎光臨!34   </div>35 </div>36 </body>37 </html>

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.