Results 1 to 2 of 2

Thread: Lazy Load on Div

  1. #1
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    456
    Thanks
    76
    Thanked 21 Times in 21 Posts

    Default Lazy Load on Div

    Hi, i have this new project that implement Lazy Load Jquery.
    But i have a lot of image, and the .gif loader make my page look like a mess.
    http://davejob.com/testing/

    So if i want to attach it to <div> how to make it right?

    I try this:
    Code:
    <script type="text/javascript" charset="utf-8">
    	$(function() {
    		$("div .loading").lazyload({
    			effect : "fadeIn"
    		});
    	});
    </script>
    
    <div id="item2" class="item loading">
    			<a name="item2"></a>
    			<div class="content">
                <img src="images/loading.gif" data-original="images/img2.jpg"><img src="images/loading.gif" data-original="images/img5.jpg">
                <img src="images/loading.gif" data-original="images/img6.jpg"><img src="images/loading.gif" data-original="images/img6.jpg">
                <div style="position:absolute; z-index:90;"><a href="#item3" class="panel">3</a><a href="#item1" class="panel">back</a></div></div>
    		</div>
    but it don't work. Any suggestion?
    Thank you
    _____________________

    David Demetrius // davejob
    _____________________

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,926
    Thanks
    43
    Thanked 3,191 Times in 3,155 Posts
    Blog Entries
    12

    Default

    There could also be other problems, but the meaning of this selector:

    Code:
    $("div .loading")
    is - all elements with a class of loading that are direct or indirect descendants of a div element.

    I think what you meant is:

    Code:
    $("div.loading")
    which means - all div elements that have a class of loading.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •