我一直在玩jquery插件Jquery Transit:http://ricostacruz.com/jquery.transit/但无论我做什么,代码的行为都不像我预期的那样(事实上,它不会表现根本)Jquery Transit不能正常工作
<!DOCTYPE html>
<html>
<head>
<style>
div {
background-color:yellow;
width:100px;
border:1px solid blue;
position:absolute;
left:50px;
}
</style>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js'></script>
<script scr='jquery.transit.js'></script>
</head>
<title>test</title>
</head><body>
<button id="go"> Run</button>
<div id="block">Hello!</div>
<script>
$(function() {
$("#go").click(
function(){
$("#block").transition({ x: '90px' }, 1500);
});
});
</script>
</body>
</html>
该代码根本不起作用。我添加了jquery动画代码来比较它,这很好地工作。现在我知道jquery 1.8打破了jquery过境,但我在这里使用jquery 1.7,所以这不应该是一个问题。
我在这里亏本,有人有什么想法吗?
编辑:
我跟着大家的指示和创造了这个: http://web.uvic.ca/~markkoni/ ,虽然例子似乎工作的jsfiddle它在实践中行不通。
用$(function {code})关闭您的单击事件调度程序; –
我编辑了我的答案,您的脚本标记不正确。 – rayfranco
Marcin,您输入了错误的scr =“”http://i.imgur.com/wbuxm.png使用记事本++或其他颜色为hilight的IDE,因此您会看到是否存在语法问题 – fedmich