實(shí)在是看不出來了,求幫助看看哪里錯(cuò)了,謝謝
<!DOCTYPE html>
<html>
? ? <head>
? ? ? ? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
? ? ? ? <title>jQuery動(dòng)畫特效</title>
? ? </head>
? ? <style>
? ? ? ?div{
? ? ? ? ?height:50px;
? ? ? ? ?width:50px;
? ? ? ? background:red; ?
? ? ? ? position:relative;?
? ? ? ? left:100px;
? ? ? ? top:100px;
? ? }
? ? </style>
? ? <body>
? ? ? ? <div></div>
? ? ? ? <span></span>
? ? ? ? <input id="left" type="button" value="左移" />
? ? ? ? <input id="right" type="button" value="右移" />
? ? </body>
? ?<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script> ??
? ?<script>
$(function(){
? ??
? ?$("#left").blind("click",function(){
? ? ? ?
? ? ? ?$("div").animate({
? ? ? ? ? ?left:"-=100px"
? ? ? ?},1000,function(){
? ? ? ? ? ?$("span").html("左移")
? ? ? ?})
? ?
? ?
? ?$("#right").blind("click",function(){
? ? ? ?$("div").animate({
? ? ? ? ? ?left:"+=100px"
? ? ? ?},1000,function(){
? ? ? ? ? ?$("span").html("右移")
? ? ? ?})
? ? ? ?
? ?}) ? ? ? ??
})
? ? </script>
</html>
2016-03-11
綁定事件bind單詞寫錯(cuò)了
2016-03-05
<!DOCTYPE html>
<html>
??? <head>
??????? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
??????? <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
?? <script>
$(function(){
?? $("#left").bind("click",function(){
?????? $("div").animate({
?????????? left:"-=100px"
?????? },1000,function(){
?????????? $("span").html("左移")
?????? });
});
?? $("#right").bind("click",function(){
?????? $("div").animate({
?????????? left:"+=100px"
?????? },1000,function(){
?????????? $("span").html("右移")
?????? });
?? });
});
??? </script>
??????? <title>jQuery動(dòng)畫特效</title>
??? </head>
??? <style>
?????? div{
???????? height:50px;
???????? width:50px;
??????? background:red;
??????? position:relative;
??????? left:100px;
??????? top:100px;
??? }
??? </style>
??? <body>
??????? <div></div>
??????? <span></span>
??????? <input id="left" type="button" value="左移" />
??????? <input id="right" type="button" value="右移" />
??? </body>
</html>
有倆個(gè)地方錯(cuò)誤!自己多看看吧