我对jquery很新,我很想知道为什么我的函数不工作。我正在做一个'圣诞老人'动画。他的身体和一只手臂彼此分开。这部动画的目的是单手挥动一次。这里是我的代码:jquery中的动画
HTML
<!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>Naamloos document</title>
</head>
<body>
<div id="redbtn"></div>
<div id="santa_body">
<div id="santa_arm"><img src="onderdelen/hand.png" /></div>
<div id="santa_corpse"><img src="onderdelen/kerstman.png" /></div>
</div>
</body>
</html>
CSS
#redbtn{
width:50px;
height:50px;
background-color:#F00;
float:left;
margin-top:30px;
}
#santa_body{
height:100px;
width:100px;
margin-left:auto;
margin-right:auto;
z-index:3;
}
#santa_arm{
margin-top: 100px;
margin-right: auto;
margin-bottom: 0;
margin-left: 330px;
background-repeat: no-repeat;
background-position: left top;
width: 400px;
height:200px;
z-index:1;
float:left;
}
#santa_corpse{
z-index: 2;
width:500px;
height:600px;
position:absolute;
background-repeat:no-repeat;
float:right;
}
的JavaScript
$("#redbtn").click(
function(){
$("#santa_arm").animate({
path : new $.path.arc({
center : [200,200],
radius : 150,
start : 0,
end : -360 * 40,
dir : -1
})
},40000);
});
首先 - 我没有看到jQuery JS文件链接到您的HTML页面... – ManseUK 2011-12-20 11:45:45
任何即时通讯猜测您使用此 - > http://motyar.blogspot.com /2010/08/jquery-animate-in-circular-path.html再次未链接? – ManseUK 2011-12-20 11:46:36
运行时会出现什么错误?调试器中的任何东西? JavaScript控制台?什么? (抱歉的多个评论) – ManseUK 2011-12-20 11:47:17