最新国产好看的视频,伊人天堂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)論

宽甸| 益阳市| 清镇市| 舒城县| 南宁市| 蓬溪县| 团风县| 缙云县| 青冈县| 乐亭县| 喀喇| 分宜县| 阿拉善盟| 分宜县| 富裕县| 棋牌| 平安县| 龙口市| 新竹县| 莱西市| 论坛| 东港市| 乌兰浩特市| 岫岩| 通辽市| 温州市| 九龙坡区| 石狮市| 江北区| 仁寿县| 贵阳市| 南部县| 津市市| 滕州市| 平舆县| 肇源县| 时尚| 芷江| 若尔盖县| 亚东县| 定远县|