請問這段代碼有什么問題,這樣連起來寫有問題?
<!DOCTYPE html>
<html>
??? <head>
??????? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
??????? <title>jQuery動畫特效</title>
??????? <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
??????? <style>
??????????? div{
??????????????? position:relative;
??????????????? margin:5px;
??????????????? width:100px;
??????????????? height:100px;
??????????????? border:2px solid #999;
??????????????? background:#f60;
?????????????? ?
??????????????? }
??????? </style>
??? </head>
??? <body>
??????? <button class="i">按鈕1--左移動</button>
??????? <button class="j">按鈕2--右移動</button>
??????? <div>hello world</div>
??????? <script type="text/javascript">
??????????? $(function)(){
??????????????? $(".i").bind("click",function(){
??????????????????? $("div").animate({
??????????????????????? left:"+=50px" },1000,function(){
??????????????????? $(".j").bind("click",function(){
??????????????????????? $("div").animate({
??????????????????????? right:"-=50" },1000,function()
??????????????????????? {$("div").html(執行結束!)})
??????????????????? })})})}
????????????????????? ?
??????? </script>
??? </body>
</html>
2022-03-24
大神也都當過菜鳥,加油點擊標題欄中的Window選擇ShowView就可以在里面選擇您想要的相應菜單
2016-04-13
你的錯誤太多了,我在你的代碼基礎上給你改的,你自己對比看一下。注意代碼書寫規范,你的寫的有點亂。
2016-04-13
<!DOCTYPE html>
<html>
? ? <head>
? ? ? ? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
? ? ? ? <title>jQuery動畫特效</title>
? ? ? ? <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
? ? ? ? <style>
? ? ? ? ? ? div{
? ? ? ? ? ? ? ? position:relative;
? ? ? ? ? ? ? ? margin:5px;
? ? ? ? ? ? ? ? width:100px;
? ? ? ? ? ? ? ? height:100px;
? ? ? ? ? ? ? ? border:2px solid #999;
? ? ? ? ? ? ? ? background:#f60;
? ? ? ? ? ? ? ? left:200px;
? ? ? ? ? ? ? ? }
? ? ? ? </style>
? ? </head>
? ? <body>
? ? ? ? <button class="i">按鈕1--左移動</button>
? ? ? ? <button class="j">按鈕2--右移動</button>
? ? ? ? <div>hello world</div>
? ? ? ? <script type="text/javascript">
? ? ? ? ? ? $(function(){
? ? ? ? ? ? ? ? $(".i").bind("click",function(){
? ? ? ? ? ? ? ? ? ? $("div").animate({left:"-=50px" },1000)
});
$(".j").bind("click",function(){
$("div").animate({left:"+=50px" },1000,function(){
$("div").html("執行結束!")
})
});
})
? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? </script>
? ? </body>
</html>