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

jquery的事件方法和總結

原創(chuàng) 2019-01-08 16:35:21 212
摘要:<!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("窗口調整")

// $('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>

  當前調整次數(shù):<p> </p> -->

測試內容

  

</div>

</body>

</html>



<!--jquery事件方法總結


$(document).ready(function(){})

簡潔:$(function(){})


$('p').click()


dblclick() 雙擊


mouseenter() 鼠標穿過


mouseleave()  鼠標離開


mousedown()  移到上方


mouseup()     松開鼠標


hover()  移上移開


focus()  獲得焦點

blur()   失去焦點


toggle()  隱藏或可見


 -->


批改老師:滅絕師太批改時間:2019-01-08 16:56:42
老師總結:完成的不錯,基本都是測試,下次作業(yè)最好帶上案例奧!

發(fā)布手記

熱門詞條