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
6 Comments
Unfortunately, requiring the author to use the
longdescattribute (which is omitted in HTML5 by the way) instead ofsrcimplies 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?@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!
@Mathias: LazyLoad doesn’t work with normal markup as you can read on the project’s page: http://www.appelsiini.net/projects/lazyload
@Balazs: They must change the last version, and they are using the same technique that this plugin.
no good for SEO(Search Engine Optimization)?
You are right. Google doesn’t index this images. But you have to make a trade-off between speed vs index
One Trackback
[...] (The english version) [...]