jQuery: document ready fires too early for my requirements

前端 未结 6 1360
隐瞒了意图╮
隐瞒了意图╮ 2020-12-09 02:57

I am developing a site based all around photos. Some areas of this site require calculations based on image dimensions in order to work correctly. What i have found is that

6条回答
  •  攒了一身酷
    2020-12-09 03:36

    Try this instead:

    $(window).load(function() {
     alert("images are loaded!");
    });
    

    See this link for a comparison of $(document).ready() and $(window).load()

    http://4loc.wordpress.com/2009/04/28/documentready-vs-windowload/

提交回复
热议问题