2012-03-22 22 views
0

我目前使用Spritely在jQuery中創建動畫。僅在mouseover上播放Spritely動畫

我怎麼會去了鼠標上播放動畫一次,然後停在鼠標移出動畫...

任何幫助將是巨大的感謝,這是當前的代碼:

(function($) { 
      $('#booth').bind("mouseenter", function() { 
       $('#phone').sprite({fps: 24, no_of_frames: 36}) 
       $(this).unbind(); 
      }); 

      $('#booth').bind("mouseout", function() { 
       $(this).stop(); 
       $(this).unbind(); 
      }); 
     })(jQuery); 
+0

你還在尋找嗎? – bottleboot 2012-04-24 10:02:12

回答

1

從興致文檔,它看起來像.spStop()是你想要的方式:

 $('#booth').bind("mouseout", function() { 
      $(this).spStop(); 
      $(this).unbind(); 
     }); 
+0

嘿感謝您的快速反應......但沒有似乎沒有工作..我仍然環顧四周.. – 2012-03-22 12:51:42

0

我認爲你正在尋找.destroy()

使代碼:

$('#booth').bind("mouseout", function() { 
    $(this).destroy(); 
     $(this).unbind(); 
});` 

我一直在使用它,以及破壞方法停止動畫。