Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

Need a code of lazy load for div.

user-image
Question ajoutée par Atif Aqeel , Founder And Director , Xesense
Date de publication: 2013/10/03
Zaid Rabab'a
par Zaid Rabab'a , Software Development Team Leader , Al-Safa Co. Ltd.

I think the guys have the perfect answers

Muhammad Majid Saleem
par 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
par Hamada Sarhan , Wood Furniture Production Manager , bedquarter factory

than you

i agree with Answer added by: Fadi

Atif Aqeel
par 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
par 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
par 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

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?