JAIL icon indicating copy to clipboard operation
JAIL copied to clipboard

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

Open daniel opened this issue 12 years ago • 1 comments

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>

daniel avatar Oct 22 '12 08:10 daniel

having the same problem...

solti avatar Dec 10 '12 12:12 solti