利用jQuery實現動態背景特效



43 169 57



特效描述:利用jQuery實現 動態背景特效,利用jQuery實現動態背景特效

代碼結構

1. 引入CSS

<link rel="stylesheet" type="text/css" media="screen" href="css/style.css" />

2. 引入JS

<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
<script type="text/javascript" src="js/pngFix.js"></script>

3. HTML代碼

<div id="wrapper">
<h3>Example 1</h3>
<div id="container">
    <div id="overlay" class="png-fix">
         <div id="title">
              ooh,<br />pretty.
         </div>
    </div>
</div>
<p>Notice how the background slowly changes colour over time. Refresh the page a few times - you will see that the overlaid image moves around as well. This creates a unique effect on every page load, meaning that you will never have exactly the same design element twice. Leave us a comment to show how you have implemented this effect into your designs - we'd love to see how creative you have got!</p>
<br />
<h3>Example 2</h3>
<p>The below effect was achieved by adding a third div inside the 'id="overlay"' containing div. Giving it absolute positioning as well means you can then use a transparent png image in the foreground of this third div. Obviously, being transparent, you can see through certain areas of this .png and on to the background we have created. </p>
<br />
<a name="downloadit"></a>
<div id="container2">
    <div id="overlay2" class="png-fix">
         <div id="download">
           <a href="#" title="Download the .zip folder">
              <img src="images/example2.png" alt="Download it Image" class="png-fix" />
           </a>
         </div>
    </div>
</div>
<br />
<br />
<br />
Thanks for looking, have fun!
</div>
<div style="text-align:center;clear:both">
</div>



用戶評論
大牛,別默默的看了,快登錄幫我點評一下吧!:)      登錄 | 注冊


熱門標簽: 滾動切換 滾動條切換 滑動選項卡 滑動切換 加載動畫 選項卡切換 選項卡 切換 tab切換 頁面切換 選項卡插件 切換插件 滑動手風琴 h5彈窗動畫 html5彈窗動畫 h5動畫 h5背景動畫 h5場景動畫 h53D動畫 h5界面動畫 html5動畫 h5按鈕動畫 html5按鈕動畫 h5圖片動畫 h5圖標動畫 html5圖片動畫 html5圖標動畫 背景切換 大圖切換
?
×
×

注冊

官方QQ群

掃描上面二維碼加微信群

官方QQ群

jQuery/js討論群
群號:642649996
Css3+Html5討論群
群號:322131262

加群請備注:從官網了解到

老夫子电子