jQuery: mouseenter() method
Phương thức mouseenter() sẽ được kích hoạt khi người dùng di chuyển chuột chạm vào phần từ HTML.
Ví dụ:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://ajax.googleapis. com/ajax/libs/jquery/1.11.0 /jquery.min.js">
</script>
<script>
$(function(){
$("div").mouseenter(function(){
$(this).hide(1000);
});
});
</script>
<style>
div{
width:50%;
height:50px;
text-align:center;
background:green;
color:white;
cursor:pointer;
}
</style>
</head>
<body>
<div>Di chuyển chuột đi vào tôi => Tôi ẩn</div>
</body>
</html>