最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jQuery實(shí)現(xiàn)移動(dòng) 和 漸變特效的點(diǎn)擊事件

 更新時(shí)間:2015年02月26日 11:06:26   投稿:hebedich  
這里給大家分享的是一則使用jQuery實(shí)現(xiàn)移動(dòng)和漸變特效的點(diǎn)擊事件效果,非常簡(jiǎn)單實(shí)用,這里推薦給大家。

先看代碼:

復(fù)制代碼 代碼如下:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <script src="js/jquery.js"></script>
    </head>
<style>
body{font-family: "微軟雅黑";width: 980px; margin: 0 auto; text-align: center;}
    .box{
        width: 300px;
        height: 300px;
        background: green;
        border: 1px solid #e6e6e6;
        margintop: 50px;
        line-height: 200px;
        position: absolute;
    }
button{
    border: none;
    background: green;   
    width: 100px;
    height: 50px;
    line-height: 50px;
    color: #fff;
    font-size: 16px;
    margin-top: 50px;
    }
</style>
    <body>
        <button>點(diǎn)擊開(kāi)始動(dòng)畫(huà)</button>
        <div class="box" ></div>
        <script>
            $(document).ready(function(){
              $("button").click(function(){
                var div=$(".box");
                div.animate({height:'200px',opacity:'0.4'},"slow");
                div.animate({width:'200px',opacity:'0.8'},"slow");
                div.animate({height:'100px',opacity:'0.4'},"slow");
                div.animate({width:'100px',opacity:'0.8'},"slow");
                div.animate({right:'100px',opacity:'0.8'},"slow");
                div.animate({bottom:'100px',opacity:'0.8'},"slow");
                div.animate({left:'100px',opacity:'0.8'},"slow");
                div.animate({top:'100px',opacity:'0.8'},"slow");
              });
            });
        </script>
        <script>
            $(document).ready(function(){
                $("button").click(function(){
                    var div=$(".box");
                        div.animate({height:'300px',opacity:'0.4'},"slow");
                        div.animate({width:'300px',opacity:'0.8'},"slow");
                        div.animate({height:'100px',opacity:'0.4'},"slow");
                        div.animate({width:'100px',opacity:'0.8'},"slow");
                    });
                });
            });
        </script>
    </body>
</html>

.animate  事件,是這個(gè) 里面的新的東西。解釋起來(lái)就是  使div 塊兒  變得有靈魂 可以移動(dòng)。

 Tips:

1、click 事件的  點(diǎn)擊節(jié)點(diǎn)的選擇

2、通過(guò) var div=$(".box")  來(lái)選擇需要控制的 css 屬性

剩下的就要靠 自己去敲代碼,看效果 去理解其中的 意思。

相關(guān)文章

最新評(píng)論

潮安县| 宜兰县| 通城县| 从江县| 志丹县| 汶上县| 册亨县| 德安县| 乐清市| 和硕县| 宜城市| 朔州市| 商洛市| 万全县| 浪卡子县| 颍上县| 巴林右旗| 沂水县| 织金县| 天津市| 云安县| 三都| 佛山市| 浪卡子县| 林州市| 那坡县| 西青区| 溧阳市| 舟曲县| 巴南区| 阿拉善右旗| 南雄市| 井研县| 都安| 武邑县| 呼和浩特市| 日土县| 秀山| 乌拉特前旗| 廊坊市| 靖江市|