码迷,mamicode.com
首页 > Web开发 > 详细

jquery点击div 先变大再缩小

时间:2017-08-14 16:23:54      阅读:308      评论:0      收藏:0      [点我收藏+]

标签:code   http   htm   .com   this   color   func   doc   tle   

<!DOCTYPE html>
<html>
  <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
        <title>
         jquery点击div 先变大再缩小
        </title>
        <script>
            $(function(){
                $("div").toggle(function(){
                    $(this).css({
                     "width":"900px",
                      "height":"500px",
                      "position":"absolute",
                      "top":"0",
                      "left":"0"
                    });
                },function(){
                    $(this).css({
                         "width":"200px",
                         "height":"200px",
                    
                        
                    });
                });
            })
        </script>
  </head>
    <body>
    <div style="background-color:blue">
            点击
        </div>
  </body>
</html>

jquery点击div 先变大再缩小

标签:code   http   htm   .com   this   color   func   doc   tle   

原文地址:http://www.cnblogs.com/Yoko-815/p/7357987.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!