首頁  >  文章  >  web前端  >  jQuery實作移動 和 漸層特效的點擊事件_jquery

jQuery實作移動 和 漸層特效的點擊事件_jquery

WBOY
WBOY原創
2016-05-16 16:12:501208瀏覽

先看程式碼:

複製程式碼 程式碼如下:



   
       
       
       
   

   
       
       

       
            $(文檔).ready(function(){
              $("按鈕").click(function(){
                var div=$(".box");
                div.animate({高度:'200px',不透明度:'0.4'},"慢");
                div.animate({寬度:'200px',不透明度:'0.8'},"慢");
                div.animate({高度:'100px',不透明度:'0.4'},"慢");
                div.animate({寬度:'100px',不透明度:'0.8'},"慢");
                div.animate({right:'100px',opacity:'0.8'},"慢");
                div.animate({bottom:'100px',opacity:'0.8'},"慢");
                div.animate({left:'100px',opacity:'0.8'},"慢");
                div.animate({top:'100px',opacity:'0.8'},"慢");
              });
            });
        腳本>
       
            $(文檔).ready(function(){
                $("按鈕").click(function(){
                    var div=$(".box");
                        div.animate({高度:'300px',不透明度:'0.4'},"慢");
                        div.animate({寬度:'300px',不透明度:'0.8'},"慢");
                        div.animate({高度:'100px',不透明度:'0.4'},"慢");
                        div.animate({寬度:'100px',不透明度:'0.8'},"慢");
                    });
                });
            });
        腳本>
    身體>
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn