![]() |
Deferring loading of images on thumbnail blocks
I am using javascript to hide/show DIV blocks. Now, as you can also see, all the images from both DIV blocks are downloaded even if the second is hidden.
This is the page: http://www.exquisiteangelz.com/galleries/picture/ What I wish to do is defer the loading of the hidden block and make it load the images only when the visitor clicks to display the block in question. Does someone happen to know if it is possible to defer the loading of images so that they are loaded only when the visitor clicks to view the thumbnail block in question? And if yes, would you be kind enough to provide the code to implement it? I'd appreciate any help. |
jquery (or mootools) will likely have a library that does lazy loading or asynchronous loading of images. lazy loading loads the images as they are pulled into the viewport - asynchronous allows the page to load and then loads the images sequentially on the page. jquery (or mootools) will also allow you to control dom units so that you could have an onclick handler that would populate the with the appropriate html which would then load the images/html.
ajaxrain.com would probably be one source for an addon that would do it. |
Quote:
Code:
|
Their online documentation is superb for being an open source product:
http://docs.jquery.com/Main_Page However, I wouldn't be surprised if you couldn't find an addon that someone has already written at http://www.ajaxrain.com/ or http://plugins.jquery.com/ |
Quote:
|
If you have the div show up on a click, you want to do this, if you are using jQuery:
$('#id-for-the-link').click(function() { // do div showing here return false; }); The 'false' will not process the link that goes to '#' which is what yoinks you back to the top of the page. |
Optionally throw me a link to the page in PM and I'll hack it over to jQuery for you :)
|
Quote:
|
Quote:
Here is the link: http://www.exquisiteangelz.com/galleries/picture/ |
Quote:
|
All times are GMT -4. The time now is 03:26 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc