jquery 浏览器放大缩小函数resize

  <script>
            $(function(){
                $(window).resize(function(){
                    var _height = $(window).height();
                    var _conheight = $('#footer').height();
                    
                    var temp = (_height - _conheight)/2;
                    if(temp>0) {
                        $('#footer').css('margin-top', temp);
                    }else {
                        $('#footer').css('margin-top', 0);
                    }
                });
            });

 

posted @ 2013-10-28 19:46  kevin_xk  阅读(702)  评论(0编辑  收藏  举报