Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lazy Load, Lazier Load.. Control Fade Speed?

Normal lazy load plug in:

$(function() {          
    $("img").lazyload({
        placeholder : "img/grey.gif",
        effect      : "fadeIn"
    });
});  

Can I control the speed of the fadeIn aspect say 0.9 or 1 second?

Is that possible?

like image 439
Jezthomp Avatar asked Oct 26 '10 10:10

Jezthomp


People also ask

Does lazy loading improve speed?

Used with care, lazy-loading images and video can seriously lower the initial load time and page payloads on your site. Users won't incur unnecessary network activity and processing costs of media resources they may never see, but they can still view those resources if they want.

How does lazy loading work?

Lazy loading is a technique for waiting to load certain parts of a webpage — especially images — until they are needed. Instead of loading everything all at once, known as "eager" loading, the browser does not request certain resources until the user interacts in such a way that the resources are needed.

What is lazy loading and how do you achieve it?

Lazy Loading Images is a set of techniques in web and application development that defer the loading of images on a page to a later point in time - when those images are actually needed, instead of loading them up front.

How do you do lazy loading when should you use lazy loading?

With lazy loading, a web page loads only required content at first, and waits to load any remaining page content until the user needs it. Lazy loading reduces the time it takes for a web page to open because the browser only loads a fraction of the content on the page at a time.


1 Answers

There's an effectspeed setting as well, for example:

$(function() {
  $("img").lazyload({ 
    placeholder : "img/grey.gif", 
    effect : "fadeIn", 
    effectspeed: 900 
  }); 
});

I don't have an API reference, as the site seems to be unstable at the moment, but you can see it used in the source here: http://www.appelsiini.net/projects/lazyload/jquery.lazyload.js

like image 87
Nick Craver Avatar answered Nov 15 '22 00:11

Nick Craver