我想在鼠標懸停時放大圖像,並在鼠標移出後將大小縮小回正常。我有以下幾點:使用Jquery在鼠標懸停時放大圖像?
$('#image img').live("mouseover", function(){
var $this=$(this);
$this.attr('width','25%');
$this.attr('height','25%');
})
的擴大部分工作正常,但我不知道如何鼠標移開後減小尺寸。此外,我認爲我的代碼有點難看,不知道如何解決它。非常感謝。
你爲什麼不使用'.hover()'? – Blender 2012-08-01 23:59:20
@Blender我認爲自己腦中凍結了':)''因爲我讀了'mouseover'並且使用了'mouseenter'''''''' yep會立即改變,謝謝你bruvnic! – 2012-08-02 00:00:43
@Blender done::)'http://jsfiddle.net/FPKAP/12/ – 2012-08-02 00:03:18