嗨,我正在制作一个jquery动画。我在jquery方面没有太多经验,但是我知道基本语法。这是我到目前为止所得到的...
<!DOCTYPE html>
<html>
<title>Nathan</title>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"/>
<script>
$(document).ready(function(){
$("button").click(function(){
$("#N").animate({left:'250px'});
});
});
</script>
</head>
<body>
<button>CLICK</button>
<div id="N" style="margin-left:200px;"><image src="http://upload.wikimedia.org/wikipedia/en/8/88/Letter_N-1-.png" height="44" width="44"/></div>
<image src="http://b68389.medialib.glogster.com/media/3cf5bc6910ded698d225a3be66fb7bec27443f45eaa12ee7d207847f79152a10/bubble-graffiti-alphabet-letter-l.jpg" height="44" width="44"/>
</body>
</html>
我试图发挥作用:
<div id="N" style="margin-left:200px;"><image src="http://upload.wikimedia.org/wikipedia/en/8/88/Letter_N-1-.png" height="44" width="44"/></div>
与我的jQuery脚本。
当我单击按钮时,图像不会移动。
我做错了什么?
如何编辑代码,使其与我一起使用,<div id="N"
以便可以移动图像?
试试这个给
position:relative
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句