不知道為什么運(yùn)行不了,求解答~
<!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>
? ? ? ? <title>jQuery動(dòng)畫特效</title>
? ? ? ? <style>
? ? ? ? ? ? span{
? ? position:absolute;
? ? width:80px;
? ? height:80px;
? ? border: solid 1px #ccc;
? ? margin: 0px 8px;
? ? background-color: Red;
? ? color:White;
? ? vertical-align:middle
? ? ? ? ? ? ? ? }
? ? ? ? </style>
? ? </head>
? ??
? ? <body>
? ? ? <input id="toleft" type="button" value="左移" />
? ? ? <input id="toright" type="button" value="右移" />
? ? ? <span></span>
? ? ? <div></div>
? ? ? <script>
? ? ? ? ? $("#toleft").bind("click",function(){
? ? ? ? ? ? ? $("span").animate({
? ? ? ? ? ? ? ? ? right:"+=50px";
? ? ? ? ? ? ? },3000,function(){
? ? ? ? ? ? ? ? ? $("div").html('執(zhí)行完成');
? ? ? ? ? ? ? })
? ? ? ? ? ? ? });
? ? ? ? ? ? ? $("#toright").bind("click",function(){
? ? ? ? ? ? ? $("span").animate({
? ? ? ? ? ? ? ? ? left:"+=50px";
? ? ? ? ? ? ? },3000,function(){
? ? ? ? ? ? ? ? ? $("div").html('執(zhí)行完成');
? ? ? ? ? ? ? })
? ? ? ? ? ? ? })
? ? ? </script>
? ? </body>
</html>
2016-04-11
right和left是屬性,要加引號(hào),后面的分號(hào)可以不用