我正在尝试通过 jquery 动画移动一个部门的背景图像,但它没有移动。当我尝试移动它时,图像只是晃动。我想创建一个幻灯片并希望背景图像移动,让我们说单击,我希望背景图像占据整个分区,然后单击它应该保持其大小并向右或向左移动。请检查代码here http://jsfiddle.net/sSYKD/1/
<!DOCTYPE html>
<html>
<head>
<script src="jquery-1.8.js"></script>
<style>
.blueScreen {
background:url(http://s21.postimg.org/quy8jsc0n/blue_Screen.png);
background-size:100% 100%;
width:100%;
height:500px;
}
.contentBlueScreen {
display:inline-block;
color:white;
background:url(http://i.imgur.com/a5m0HGp.png);
background-size:100% 100%;
width:100%;
height:500px;
}
</style>
<script>
$(document).ready(function() {
$("#theButton").click(function() {
$(".contentBlueScreen").animate({backgroundPosition:"200%"},3000);
});
});
</script>
</head>
<body>
<div class="blueScreen">
<div class="contentBlueScreen">
<button id="theButton">MOve it</button>
</div>
</div>
</body>
</html>