亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

jquery常用事件作業(yè)

??? 2018-12-19 00:37:06 275
????:第一遍 blur()當(dāng)元素失去焦點(diǎn)==onblur focus()當(dāng)元素獲得焦點(diǎn) change()當(dāng)元素的值發(fā)生改變的時(shí)候 click()點(diǎn)擊事件 dblclick()雙擊事件 mouseover()  當(dāng)鼠標(biāo)指針位于元素上方時(shí)會發(fā)生mouseover事件 mouseenter() 當(dāng)鼠標(biāo)指針穿過元素時(shí)會發(fā)生mouseenter事件 mousemove
第一遍
	blur()當(dāng)元素失去焦點(diǎn)==onblur
	focus()當(dāng)元素獲得焦點(diǎn)
	change()當(dāng)元素的值發(fā)生改變的時(shí)候
	click()點(diǎn)擊事件
	dblclick()雙擊事件
	mouseover()  當(dāng)鼠標(biāo)指針位于元素上方時(shí)會發(fā)生mouseover事件
	mouseenter() 當(dāng)鼠標(biāo)指針穿過元素時(shí)會發(fā)生mouseenter事件
	mousemove()  當(dāng)鼠標(biāo)指針在指定的元素中移動時(shí),就會發(fā)生該事件
	mouseleave() 當(dāng)鼠標(biāo)指針離開元素時(shí)
	mouseout()   當(dāng)鼠標(biāo)指針移動到元素上方并按下鼠標(biāo)按鍵時(shí)
	mouseup()    當(dāng)在元素上松開鼠標(biāo)按鍵時(shí)
	resize()     當(dāng)調(diào)整當(dāng)前瀏覽器窗口大小時(shí)
	pageX()      屬性是鼠標(biāo)指針的位置,相對于文檔的左邊緣 event.pageX event:必需 參數(shù)來自事件綁定函數(shù)
	pageY()      屬性是鼠標(biāo)指針的位置,相對于文檔的上邊緣 event.pageY event:必需 參數(shù)來自事件綁定函數(shù)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>hiki</title>
     <script type="text/javascript" src="jquery-3.3.1.min.js"></script>
</head>
<body>
<script type="text/javascript">
//在Jquery中是以調(diào)用事件函數(shù)的形式來觸發(fā)事件的,如js中的onclick事件,在Jquery用click()來替代
//簡單的理解:事件方法會觸發(fā)匹配元素的事件,或者將函數(shù)綁定到所有匹配元素的某個(gè)事件
//ready() 當(dāng)我們的DOM已經(jīng)加載完成,頁面已經(jīng)加載完,觸發(fā)的事件==js的onload
     // $(document).ready(function(){

     // })
//不能與<body onload="">一起使用
// blur()當(dāng)元素失去焦點(diǎn)==onblur
// focus()當(dāng)元素獲得的焦點(diǎn)
// change()當(dāng)元素的值發(fā)生改變的時(shí)候
// click()點(diǎn)擊事件
// dblclick()雙擊事件
// mouseover()  當(dāng)鼠標(biāo)指針位于元素上方時(shí)會發(fā)生mouseover事件
// mouseenter() 當(dāng)鼠標(biāo)指針穿過元素時(shí)會發(fā)生mouseenter事件
// mousemove()  當(dāng)鼠標(biāo)指針在指定的元素中移動時(shí),就會發(fā)生該事件
// mouseleave() 當(dāng)鼠標(biāo)指針離開元素時(shí)
// mouseout()   當(dāng)鼠標(biāo)指針移動到元素上方并按下鼠標(biāo)按鍵時(shí)
// mouseup()    當(dāng)在元素上松開鼠標(biāo)按鍵時(shí)
// resize()     當(dāng)調(diào)整當(dāng)前瀏覽器窗口大小時(shí)
// pageX()      屬性是鼠標(biāo)指針的位置,相對于文檔的左邊緣 event.pageX event:必需 參數(shù)來自事件綁定函數(shù)
// pageY()      屬性是鼠標(biāo)指針的位置,相對于文檔的上邊緣 event.pageY event:必需 參數(shù)來自事件綁定函數(shù)

  //    $(document).ready(function(){
// // $('input').blur(function(){
// //  $('input').css('background','red')
// // })
// // $('input').focus(function(){
// //  $('input').css('background','blue')
// // })
// // $('input').change(function(){
// //  $('input').css('background','pink')
// // })
// // $('button').click(function(){
// //  $('div').css({'background':'pink','border-radius':'50px'})
// // })
// // $('div').dblclick(function(){
// //  $(this).css({'background':'blue','border-radius':'10px'})
// // })

  //    })

  $(document).ready(function(){
// $(document).mousemove(function(aa){
// $('span').text('x: '+aa.pageX+'y: '+aa.pageY)
// })
   a=0
   $(window).resize(function(){
   // alert('窗口被調(diào)整')
   $('b').text(a++)  //瀏覽器大小調(diào)整的次數(shù)
})
})
 </script>
<!--  <input type="text" name="">
 <div style="width:100px;height:100px;background:red;margin-top:20px"></div><br>
 <button>點(diǎn)擊</button> -->
 <div>
當(dāng)前鼠標(biāo)的位置:<span> </span>
 </div>
  <div>
當(dāng)前頁面被調(diào)整的次數(shù):<b> </b>
 </div>
</body>
</html>

blur() blur() blur() 元素失去焦點(diǎn)

focus() focus() focu() 元素獲得焦點(diǎn)

change() change() change() 元素值改變時(shí)

click() click() click() 點(diǎn)擊事件

dblclick() dblclick() dblclick() 雙擊事件

下方為鼠標(biāo)指針事件

mouseover() mouseover() mouseover() 元素上方

mouseenter() mouseenter() mouseenter() 穿過元素

mousemove() mousemove() mousemove() 元素中移動

mouseleave() mouseleave() mouseleave() 離開元素

mouseout() mouseout() mouseout() 元素上方并按下鼠標(biāo)按鍵時(shí)

mouseup() mouseup() mouseup() 元素上松開鼠標(biāo)

resize() resize() resize() 瀏覽器窗口大小被調(diào)整時(shí),也可以計(jì)數(shù)調(diào)整次數(shù)括號內(nèi)傳變量

pageX() pageX() pageX() 獲取x軸位置

pageY() pageY() pageY() 獲取y軸位置


??? ??

?? ??