sebarmeli / JAIL

JqueryAsynchImageLoader Plugin for jQuery
http://sebarmeli.github.com/JAIL
MIT License
572 stars 117 forks source link

Visible images doesn't load in desktop browsers if image height is not set #32

Open daniel opened 12 years ago

daniel commented 12 years ago

There seems to be a problem in desktop browsers (Chrome/Safari) with lazy loading images that doesn't have a height set. If you scroll up, the images loads though.

I can reproduce by modifying example1_basicCall.html into this:

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <meta charset="utf-8">
        <title>jQuery Asynch Image Loader - Example 1 - Basic call</title>
        <link href="css/style.css" rel="stylesheets" />
        <script type="text/javascript" src="js/jquery.js"></script>
        <script type="text/javascript" src="../jail.js"></script>
        <script type="text/javascript">
            $(function(){
                $('img.lazy').jail();
            });
        </script>
    </head>
    <body>
        <div id="wrapper">
            <div class="content">
                <p> Images visible in the viewport loaded after DOM is ready</p>
                <div>
                    <img class="lazy" data-src="img/sample1.jpg" src="img/blank.gif"/>
                </div>
                <div>
            </div>
        </div>
    </body>
</html>
solti commented 11 years ago

having the same problem...