abstrak:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml&quo
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jquery的事件方法</title>
<script type="text/javascript" src="jquery-3.3.1.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(function(){
// $('input').blur(function(){
// $('input').css('background','red')})
// $('input').focus(function(){
// $('input').css('background','green')
// })
//$('input').change(function(){
// $('input').css('background','blue')
// })
//$('button').click(function(){
//$('input').css('background','red')
//})
//$('button').dblclick(function(){
//$('input').css('background','pink')
//})
// $(document).mousemove(function(sbwz){
//$('span').text('x:'+sbwz.pageX+'Y:'+sbwz.pageY)
// })
//X和Y要為大寫
// tzcs=0
//$(window).resize(function(){
//alert("窗口調(diào)整")
// $('p').text(tzcs++)
// })
//$('div').hover(function(){
//$(this).css('background','red')},
//函數(shù)間用,隔開
//function(){$(this).css('background','pink')}
//)
//$('button').click(function(){
// $('div').toggle().css('background','blue')
// })
$('div').mouseenter(function(){
$(this).css('background','pink')
}),
$('div').mouseleave(function(){
$(this).css('background','red')
}),
$('div').mouseup(function(){
$(this).css('background','green')
})
})
</script>
<input type="text" name="">
<button>點擊測試</button>
<div style="width:200px; height:200px; border:1px solid #CCC; ">
<!--當前鼠標的位置:<span> </span><br>
當前調(diào)整次數(shù):<p> </p> -->
測試內(nèi)容
</div>
</body>
</html>
<!--jquery事件方法總結(jié)
$(document).ready(function(){})
簡潔:$(function(){})
$('p').click()
dblclick() 雙擊
mouseenter() 鼠標穿過
mouseleave() 鼠標離開
mousedown() 移到上方
mouseup() 松開鼠標
hover() 移上移開
focus() 獲得焦點
blur() 失去焦點
toggle() 隱藏或可見
-->
Guru membetulkan:滅絕師太Masa pembetulan:2019-01-08 16:56:42
Rumusan guru:完成的不錯,基本都是測試,下次作業(yè)最好帶上案例奧!