Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

Need a code of lazy load for div.

user-image
Question added by Atif Aqeel , Founder And Director , Xesense
Date Posted: 2013/10/03
Zaid Rabab'a
by Zaid Rabab'a , Technical Team Lead , ESKADENIA Software

I think the guys have the perfect answers

Muhammad Majid Saleem
by Muhammad Majid Saleem , Senior PHP Developer / Project Manager , SwaamTech

1. For all DIVs of a page

$(function() {  $("div").lazyload({effect: 'fadeIn'});});

 

2. For a particular DIV having some ID like:

<div id="lazyload"> some content </div>

 

$(function() {  $("div#lazyload").lazyload({effect: 'fadeIn'});});

 

OR

 

$(function() {  $("#lazyload").lazyload({effect: 'fadeIn'});});

 

 

3. For a particular DIVs having some Class like:

<div class="lazyload"> some content </div>

 

$(function() {  $("div.lazyload").lazyload({effect: 'fadeIn'});});

 

OR

 

$(function() {  $(".lazyload").lazyload({effect: 'fadeIn'});});

 

4. These actions can also be performed on some trigger like Button Click, OnBlur etc

 

$(function() {

 

$("#button").click(function(){

   $(".lazyload").lazyload({effect: 'fadeIn'});

});  });

Hamada Sarhan
by Hamada Sarhan , Wood Furniture Production Manager , bedquarter factory

than you

i agree with Answer added by: Fadi

Atif Aqeel
by Atif Aqeel , Founder And Director , Xesense

I just want to know how i can implement it in a zigzag menu which is define in DIV.

Faraz Khan
by Faraz Khan , ecommerce manager , Saudi Ceramics Company

The link below should help you get your answer:

http://jquery.eisbehr.de/lazy/index.php?c=element

 

Fadi Alkhateeb
by Fadi Alkhateeb , Senior Front End Developer , NexTwo

I agree with Muhammad answer, you can you use lazyload plugin :

http://www.appelsiini.net/projects/lazyload

Also check this link that gives you some articles about plugins for lazy loading :

http://jquery-plugins.net/tag/lazy-load

More Questions Like This