ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

Need a code of lazy load for div.

user-image
تم إضافة السؤال من قبل Atif Aqeel , Founder And Director , Xesense
تاريخ النشر: 2013/10/03
Zaid Rabab'a
من قبل Zaid Rabab'a , Technical Team Lead , ESKADENIA Software

I think the guys have the perfect answers

Muhammad Majid Saleem
من قبل 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
من قبل Hamada Sarhan , Wood Furniture Production Manager , bedquarter factory

than you

i agree with Answer added by: Fadi

Atif Aqeel
من قبل 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
من قبل 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
من قبل 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

المزيد من الأسئلة المماثلة