Jquery怎样绑定,就是鼠标放上去背景色变,移除背景色变。最后要解除绑定。
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
<a href="#" id="a">鼠标放上来</a>
<script>
$('#a').mouseenter(function () { $(this).css('background-color', '#f00') }).mouseleave(function () { $(this).css('background-color', '') });
setTimeout(function () { alert('unbind'); $('#a').unbind('mouseenter').unbind('mouseleave') }, 5000)//5秒后移除hover事件
</script>
通过jquery改变css样式就行了,,$().css('background-color','#eee')就行了