var direction='right'; (function(){ var css={ 'left':'398px' }; if(direction==='right'){ direction='left'; css.left='; }else{ direction='right'; } $(,arguments.callee); })();
html:
<input type="button" class="stop-btn" value="stop" /> <div class="wrap"> <div class="box">徘徊</div> </div>
效果图: