我想要一個圖像屬性源替換鼠標進入鼠標離開事件。點擊後,圖片應保持活動狀態。點擊後我需要停止鼠標事件。到目前爲止,mouseeleave點擊後仍繼續進行,切換回圖像,這裏是下面的代碼:jquery mouseenter做到這一點,mouseleave做到這一點,請點擊做到這一點,並停止mouseenter/mouseleave事件
<script>
jQuery('.paypal').mouseenter(function(){
jQuery('.paypal').attr('src','http://url-to-my-active-image.jpg');?>');
}),
jQuery('.paypal').mouseleave(function(){
jQuery('.paypal').attr('src','http://url-to-my-inactive-image.jpg');
}),
jQuery('.paypal').click(function(){
jQuery('.paypal').css('opacity','1');
});
</script>
我怎樣才能做到這一點?
可能重複: HTTP ://stackoverflow.com/questions/8628768/stop-mouseleave-when-clicked-on-an-object – juvian