您的位置:首页 - jQuery
jquery背景图片滑动效果
先看效果,网址:
http://keleyi.com/keleyi/phtml/jquery/7.htm

更多参考:
http://keleyi.com/a/bjac/5b62295315de9ace.htm

完整代码:

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>背景图片动画</title>
<style type="text/css">
.animate{
height:300px;
width:600px;
background:url(http://keleyi.com/image/a/tvh00n12.jpg) no-repeat;
background-position:left center;
}
</style>
<script type="text/javascript" src="http://keleyi.com/keleyi/pmedia/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(function () {
$('#start_keleyi_com').click(function () {
$("div#animate_ke"+"leyi_com").animate({ backgroundPosition: "400" }, "slow");
});
$('#back_keleyi_com').click(function () {
$("div#animate_ke" + "leyi_com").animate({ backgroundPosition: "0" }, "slow");
});
});
</script>
</head>
<body>

<div id="animate_keleyi_com" class="animate">背景图片动起来,keleyi.com 各种源码 柯乐义
<ul>
<li><span>▪</span><a href="http://keleyi.com/a/bjac/768f469b95b61487.htm" title="" >单行文字间歇向上滚动</a></li>
<li><span>▪</span><a href="http://keleyi.com/a/bjac/ed5eb8c2959c619e.htm" title="" >滚动页面时DIV到达顶部时固定在顶部</a></li>
<li><span>▪</span><a href="http://keleyi.com/a/bjac/a6d651710217f7a0.htm" title="" >使用jQuery UI修饰title属性的气泡悬浮框</a></li>
<li><span>▪</span><a href="http://keleyi.com/a/bjac/bf0eb8c02085b10d.htm" title="" >jquery清空textarea等输入框</a></li>
<li><span>▪</span><a href="http://keleyi.com/a/bjac/939631bb07adb4dc.htm" title="" >jquery关灯特效</a></li>
<li><span>▪</span><a href="http://keleyi.com/a/bjac/f4a6f78d74a251c5.htm" title="" >jquery根据滚动像素显示隐藏顶部导航条</a></li>
<li><span>▪</span><a href="http://keleyi.com/a/bjac/7e8897e5ec0849e9.htm" title="" >可改变大小DIV层</a></li>
</ul>
</div>
<a id="back_keleyi_com" href="javascript:void(0)"><-动起来吧!</a>  <a id="start_keleyi_com" href="javascript:void(0)">动起来吧!-></a>
</body>
</html>
本站导航
相关文章
柯乐义 Copyright© keleyi.com