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

jquery事件切換之作業(yè)篇

Original 2019-02-12 12:19:21 240
abstract:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">&

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

<title>jQuery事件切換</title>

<script src="jquery/jquery-3.3.1.js"></script>

<style>

div{width: 400px;height: 200px;margin:50px auto;background: #ccc;text-align: center;line-height: 200px; }

button{margin: 5px;}

</style>

</head>

<body>

<script>

$(document).ready(function(){

$('#a').click(function(){

$('div').hide(1500)

})

$('#b').click(function(){

$('.box1,.box').show(1500)

})

$('.box1').mouseover(function(){

$('.box1').css('background','red')

})

$('.box1').mouseout(function(){

$('.box1').css('background','#ccc')

})

$('.box1').mouseleave(function(){

$('.box1').css('color','#fff')

})

$('.box1').mousedown(function(){

$('.box1').css('background','#000')

})

$('.box1').mouseup(function(){

$('.box1').css('background','#ccc')

})


$('.box').hover(function(){

$(this).css('border','10px solid blue')

},

function () {

$(this).css('border','2px solid red')

}

)

$('#c').click(function(){

$('div').toggle()

})


})

</script>

<div class="box">我是神奇的hover</div>

<div class="box1">我是燈神,可以幫你完成2個功能!</div>

<button id="a">點我隱藏</button>

<button id="b">點我顯示</button>

<button id="c">我比他兩厲害</button>


</body>

</html>


Correcting teacher:天蓬老師Correction time:2019-02-12 12:37:40
Teacher's summary:jQuery的DOM操作功能非常強大, 結(jié)合 實際案例,體會會更深些

Release Notes

Popular Entries