سلام به همه ..
من یه radiobottun نوشتم که می خوام با هر بار کلیک بر روی دکمه مورد نظر از طریق animate تغییر وضعیت بده. اما نمیشه.
$(".Rounded_Rectangle_green").click(function () { $(this).animate({ opacity:0.3, right: "96px", }, "1000");
وقتی یک بار کلیک میکنم میره سمت راست با 96px و میخوام مجدد که کلیک کردم بیاد سر جای اولش که برابره با right:5px
باید در کلیک دوم از Left استفاده کنید تا برگرده سر جاش
نوشتم اما کار نمیکنه
اروری میده ؟
با Firebug چک کنید و اگر ارور میده متن ارور را قرار دهید
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script> $(document).ready(function(){ $("#btnStart").click(function(){ $("div").animate({left: '250px'}); }); $("#btnBack").click(function(){ $("div").animate({left : '-250px'}); }); }); </script> </head> <body> <button id="btnStart">Start Animation</button> <button id="btnBack">Back Animation</button> <p>By default, all HTML elements have a static position, and cannot be moved. To manipulate the position, remember to first set the CSS position property of the element to relative, fixed, or absolute!</p> <div style="background:#98bf21;height:100px;width:100px;position:absolute;"></div> </body> </html>
هیچ کاربری تا کنون از این پست تشکر نکرده است
با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)