国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

jQuery事件切換

Original 2019-05-20 17:09:47 182
abstract:用到hover命令,有兩個參數(shù) 第一個是鼠標(biāo)移進(jìn),第二個是鼠標(biāo)移出.<!DOCTYPE html> <html lang="zh-cn"> <head>     <meta charset="UTF-8">    

用到hover命令,有兩個參數(shù) 第一個是鼠標(biāo)移進(jìn),第二個是鼠標(biāo)移出.

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>jQuery事件切換</title>
    <style>
 div{width: 200px;height: 100px;background-color: black}
    </style>
</head>
<body>
<button>顯示隱藏黑框</button>
<div id="box1"></div>
<hr>
<span>鼠標(biāo)在這里移動控制下面的黑框</span>
<div id="box2"></div>

<script src="jquery-3.4.0.js"></script>
<script>
 $('button').click(function () {
        $('#box1').toggle();
 });

 $('span').hover(function () {
        $('#box2').toggle();
 },function () {
        $('#box2').toggle();
 });

</script>

</body>
</html>


Correcting teacher:查無此人Correction time:2019-05-21 09:09:59
Teacher's summary:完成的不錯。jq比js簡單很多,多練習(xí),jq可以代替js操作。繼續(xù)加油。

Release Notes

Popular Entries