1
我想就其第一次點擊一個div向右滑動,當其再次點擊,我想它返回到原來的位置jQuery的2點擊功能動畫
我有以下,但div不移動,console.log甚至在第一次點擊時顯示clicked-2。
$('.note-title').click(function(){
console.log("clicked-1");
$(this).animate({'margin-left':'200px'},200);
},function(){
console.log("clicked-2");
$(this).animate({'margin-left':'0px'},200);
});
'.toggle' docs - > http://api.jquery.com/toggle-event/ –
@Vega謝謝,修正。 –
'toggle'鼠標事件是_deprecated_。 – undefined