jQuery: mousedown() method
Giải phóng thời gian, khai phóng năng lực
Khi bạn nhấn một phím nào đó của chuột xuống thì phương thức mousedown() sẽ được kích hoạt.
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").mousedown( function(){
$(this).hide(1000);
});
});
</script>
<style>
div{
width:50%;
height:50px;
text-align:center;
background:green;
color:white;
cursor:pointer;
}
</style>
</head>
<body>
<div>Nhấn phím bất kỳ của chuột vào tôi => Tôi ẩn</div>
</body>
</html>
Giải phóng thời gian, khai phóng năng lực