Load images ondemand and get a faster web

(Versión en Español)

I wrote a small script based on jquery to improve a web page performance. It is very easy to use.

Your only have to serve all the images on the page channging src by longdesc property, and adding class img-ondemand

Example: <img src=”foto.jpg” /> now it must be <img src=”” longdesc=”foto.jpg” class=”img-ondemand” />

Here you find the code and the easy steps to use it.

http://code.google.com/p/jquery-images-ondemand/

See the demo online

http://tips.freedev.com.ar/demos/load-images-ondemand.html

enjoy ;)

This entry was posted in wpo and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

6 Comments

  1. Posted 2010/09/07 at 18:19 | Permalink

    Unfortunately, requiring the author to use the longdesc attribute (which is omitted in HTML5 by the way) instead of src implies that no images will be shown at all when JavaScript is disabled.

    This plugin seems to work with normal markup: http://www.appelsiini.net/projects/lazyload/enabled.html Maybe you can look how they do it and improve your plugin so that it works with src?

    • admin
      Posted 2010/09/08 at 11:57 | Permalink

      @mathias: That is true. When I developed I didn’t know about lazyload plugin.

      But this plugin has to be loaded at header of page. That is not good if you think that jquery is a heavy external file. I’ll try to improve this issue.

      Thanks for your advice!

  2. Balázs Galambosi
    Posted 2010/12/14 at 09:13 | Permalink

    @Mathias: LazyLoad doesn’t work with normal markup as you can read on the project’s page: http://www.appelsiini.net/projects/lazyload

  3. admin
    Posted 2010/12/14 at 09:24 | Permalink

    @Balazs: They must change the last version, and they are using the same technique that this plugin.

  4. shimesaba
    Posted 2011/01/19 at 23:25 | Permalink

    no good for SEO(Search Engine Optimization)?

    • admin
      Posted 2011/01/20 at 08:58 | Permalink

      You are right. Google doesn’t index this images. But you have to make a trade-off between speed vs index

One Trackback

  1. [...] (The english version) [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">