随笔-75  评论-193  文章-5  trackbacks-0
var fixgeometry = function() {
    /* Some orientation changes leave the scroll position at something
     * that isn't 0,0. This is annoying for user experience. */
    scroll(0, 0);
    /* Calculate the geometry that our content area should take */
    var header = $(".header:visible");
    var footer = $(".footer:visible");
    var content = $(".content:visible");
    var viewport_height = $(window).height();
    
    var content_height = viewport_height - header.outerHeight() - footer.outerHeight();
    
    /* Trim margin/border/padding height */
    content_height -= (content.outerHeight() - content.height());
    content.height(content_height);
  }; /* fixgeometry */
  $(document).ready(function() {
    $(window).bind("orientationchange resize pageshow", fixgeometry);
  });
posted on 2013-01-28 10:59 The Matrix 阅读(5169) 评论(1)  编辑  收藏 所属分类: JQuery

评论:
# 打发打发 2014-10-16 14:41 | 打发打发
打发打发的  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: