$(document).ready(function() {?? ?var wwt=document.getElementById('thepic');??? $('#btn1').click(function(){???? if(wwt.style.left>=-2400+'px'){?? ??? ?? $('#thepic').animate({left:'-=600px'});?? ??? ? }?? ??? ??? else{?? ??? ???? $('#thepic').animate({left:"0"}); ?? ??? ??? }?? ? ?? ? ?});?????? $('#btn2').click(function(){?? ??? ?? ??? ?if(wwt.style.left<0+'px'){?? ??? ??? ??? ? $('#thepic').animate({left:'+=600px'});?? ??? ??? ??? ?}?? ??? ??? ??? ? else{?? ??? ??? ?$('#thepic').animate({left:"-1800px"})?? ?}});});
請問下,我點擊#btn1為什么# thepic在 left=-1200px時再點就回到left:0了?
司馬仲達
2014-09-23 09:21:56