利用jQuery实现动态背景特效



38 149 50



特效描述:利用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

加群请备注:从官网了解到