|
|
|
|
|
|
|
![]() |
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
![]() |
#1 |
And Lord, we are especially thankful for nuclear power, the cleanest, safest
energy source there is. Except for solar, which is just a pipe dream Join Date: Sep 2008
Posts: 229
|
![]() 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. |
![]() |
![]() |
![]() |
#2 |
a.k.a. Sparky
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
|
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 <div> 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.
__________________
SnapReplay.com a different way to share photos - iPhone & Android |
![]() |
![]() |
![]() |
#3 | |
And Lord, we are especially thankful for nuclear power, the cleanest, safest
energy source there is. Except for solar, which is just a pipe dream Join Date: Sep 2008
Posts: 229
|
Quote:
Code:
<script type="text/javascript"> function showonlyone(thechosenone) { var galleryblock = document.getElementsByTagName("div"); for(var x=0; x<galleryblock.length; x++) { name = galleryblock[x].getAttribute("name"); if (name == 'galleryblock') { if (galleryblock[x].id == thechosenone) { galleryblock[x].style.display = 'block'; } else { galleryblock[x].style.display = 'none'; } } } } </script> Code:
<div name="galleryblock" id="galleryblock1" style="display: block;"> <table align="center" cellspacing="5" cellpadding="0"> <tr> <td><a href="/angel/j/jenny-poussin/">Jenny Poussin</a><br><a href="/galleries/picture/j/jenny-poussin/4/jenny-poussin-exquisite-and-cute-in-sexy-naked-christmas-red-lingerie-strip-tease/"><img src="/galleries/picture/j/jenny-poussin/4/jenny-poussin-exquisite-and-cute-in-sexy-naked-christmas-red-lingerie-strip-tease/preview.jpg" width="150" height="200" border="0"></a></td> <td><a href="/angel/b/bella-bellini/">Bella Bellini</a><br><a href="/galleries/picture/b/bella-bellini/3/bella-bellini-beautiful-and-cute-in-sexy-christmas-strip-tease-inside-public-store/"><img src="/galleries/picture/b/bella-bellini/3/bella-bellini-beautiful-and-cute-in-sexy-christmas-strip-tease-inside-public-store/preview.jpg" width="150" height="200" border="0"></a></td> <td><a href="/angel/a/aaliyah-love/">Aaliyah Love</a><br><a href="/galleries/picture/a/aaliyah-love/3/aaliyah-love-cute-in-christmas-lingerie-unwrapping-herself-in-sexy-white-stockings/"><img src="/galleries/picture/a/aaliyah-love/3/aaliyah-love-cute-in-christmas-lingerie-unwrapping-herself-in-sexy-white-stockings/preview.jpg" width="150" height="200" border="0"></a></td> <td><a href="/angel/a/alexis-texas/">Alexis Texas</a><br><a href="/galleries/picture/a/alexis-texas/3/alexis-texas-looking-cute-sucking-candy-cane-after-naked-christmas-outfit-strip-tease/"><img src="/galleries/picture/a/alexis-texas/3/alexis-texas-looking-cute-sucking-candy-cane-after-naked-christmas-outfit-strip-tease/preview.jpg" width="150" height="200" border="0"></a></td> <td><a href="/angel/a/alexis-texas/">Alexis Texas</a><br><a href="/galleries/picture/a/alexis-texas/2/alexis-texas-christmas-holiday-naked-red-nightie-and-red-panties-strip-tease/"><img src="/galleries/picture/a/alexis-texas/2/alexis-texas-christmas-holiday-naked-red-nightie-and-red-panties-strip-tease/preview.jpg" width="150" height="200" border="0"></a></td> <td><a href="/angel/l/lexi-belle/">Lexi Belle</a><br><a href="/galleries/picture/l/lexi-belle/3/lexi-belle-cute-christmas-lingerie-strip-tease-in-sexy-white-fishnet-stockings/"><img src="/galleries/picture/l/lexi-belle/3/lexi-belle-cute-christmas-lingerie-strip-tease-in-sexy-white-fishnet-stockings/preview.jpg" width="150" height="200" border="0"></a></td> <td><a href="/angel/l/lexi-belle/">Lexi Belle</a><br><a href="/galleries/picture/l/lexi-belle/2/lexi-belle-looking-cute-in-christmas-outfit-strip-tease-with-candy-cane-on-her/"><img src="/galleries/picture/l/lexi-belle/2/lexi-belle-looking-cute-in-christmas-outfit-strip-tease-with-candy-cane-on-her/preview.jpg" width="150" height="200" border="0"></a></td> </tr> </table> </div> |
|
![]() |
![]() |
![]() |
#4 |
a.k.a. Sparky
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
|
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/
__________________
SnapReplay.com a different way to share photos - iPhone & Android |
![]() |
![]() |
![]() |
#5 | |
And Lord, we are especially thankful for nuclear power, the cleanest, safest
energy source there is. Except for solar, which is just a pipe dream Join Date: Sep 2008
Posts: 229
|
Quote:
|
|
![]() |
![]() |
![]() |
#6 |
If something's hard to do, then it's not worth doing
Join Date: Sep 2008
Location: Berlin, Germany
Posts: 247
|
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.
__________________
What's blue and not heavy? |
![]() |
![]() |
![]() |
#7 |
If something's hard to do, then it's not worth doing
Join Date: Sep 2008
Location: Berlin, Germany
Posts: 247
|
Optionally throw me a link to the page in PM and I'll hack it over to jQuery for you
![]()
__________________
What's blue and not heavy? |
![]() |
![]() |
![]() |
#8 | |
That which does not kill us, will try, try again.
|
Quote:
__________________
"If you're happy and you know it, think again." -- Guru Pitka |
|
![]() |
![]() |
![]() |
#9 | |
And Lord, we are especially thankful for nuclear power, the cleanest, safest
energy source there is. Except for solar, which is just a pipe dream Join Date: Sep 2008
Posts: 229
|
Quote:
Here is the link: http://www.exquisiteangelz.com/galleries/picture/ |
|
![]() |
![]() |
![]() |
#10 | |
And Lord, we are especially thankful for nuclear power, the cleanest, safest
energy source there is. Except for solar, which is just a pipe dream Join Date: Sep 2008
Posts: 229
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|