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

好方便的,可以定義一些有趣功能啦

原創(chuàng) 2018-11-22 00:23:52 195
摘要:<!DOCTYPE html> <html> <head>     <meta charset="UTF-8">     <title>jQuery事件</title>    &
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>jQuery事件</title>
    <script type="text/javascript"src="jquery-3.3.1.min.js"></script>
    <style type="text/css">
        .box{
            width: 100px;
            height: 100px;
            background: pink;
        }
    </style>
</head>
<body>
    <script type="text/javascript">
        $(document).ready(function () {
            $(document).mousemove(function(aa){
                $('span').text('x: '+aa.pageX+'y: '+aa.pageY)
            })
            $(window).resize(function(){
                console.log('窗口大小被調(diào)整了')
            })
            $('.box').mouseover(function(){
                console.log('鼠標(biāo)滑過了')
                $('.box').css({'background':'red'})
            })
            $('.box').mouseout(function(){
                console.log('鼠標(biāo)移開')
                $('.box').css({'background':'pink'})
                $('.box').css({'width':'100px'})
            })
            $('.box').mousedown(function(){
                console.log('鼠標(biāo)點(diǎn)擊下')
                $('.box').css({'background':'green'})
            })
            $('.box').mouseup(function(){
                console.log('鼠標(biāo)點(diǎn)擊完')
                $('.box').css({'background':'blue'})
            })
            $('.box').click(function(){
                console.log('鼠標(biāo)點(diǎn)擊')
                $('.box').css({'width':'200px'})
            })
            
        })
    </script>
    <div>
        當(dāng)前鼠標(biāo)位置:<span> </span>
    </div>
    <div></div>
</body>
</html>

之前聽到韋小寶老師說的代碼加上高亮,不清楚是什么意思,是上面這種選好語言,有背景顏色嗎

發(fā)佈手記

熱門詞條