您的位置:首页 > Web前端 > JQuery

jquery添加hover事件和销毁hover事件

2015-07-18 12:33 691 查看
代码
//销毁hover事件
$('#sx').click(function(){
$(this).css('background','#e6ff10');
$(this).unbind('mouseenter').unbind('mouseleave');
});
//添加hover事件
$('#sx').bind({mouseenter: function(e){
$(this).css('background','#c51616');
}, mouseleave: function(e) {
$(this).css('background','#000');
},click:function(e){

}
});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: