how to detect document size change in jquery

后端 未结 3 514
耶瑟儿~
耶瑟儿~ 2020-12-15 07:31

so suppose that clicking something would lead to a new content being loaded to the screen hence the height of document changes and whereas previously there are no scroll bar

3条回答
  •  借酒劲吻你
    2020-12-15 08:13

    Here is the solution.

    // ajdust margins when page size changes (ie rotate mobile device)
    $(window).resize(function() {
      // Do something more useful
      console.log('doc height is ' + $(window).height());
    });
    

提交回复
热议问题