PDA

View Full Version : Switch Content Script mod to keep images from loading until content is clicked?



transistor
02-27-2008, 03:57 AM
1) Script Title: Switch Content Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm

3) Describe problem: I'm using this script so users can select the size of the thumbnails on my site. So each size (small, medium, and large) have their own div. But from what I can tell, all the thumbnails load on page start, so it kind of defeats the purpose. Is there a way to keep the images from loading until the content is expanded?

Thanks!

ddadmin
02-27-2008, 06:39 AM
This would involve Ajax to dynamically fetch the contents within the collapsing DIVs. There's curently no quick way to add this feature, but I'll most likely add it the next time the script is updated, probably within the next 2-3 weeks.

transistor
02-27-2008, 11:43 PM
This would involve Ajax to dynamically fetch the contents within the collapsing DIVs. There's curently no quick way to add this feature, but I'll most likely add it the next time the script is updated, probably within the next 2-3 weeks.

Awesome, I can't wait to see that. I don't suppose there is any other method besides using Ajax?

ddadmin
02-28-2008, 03:02 AM
Well, if the content being loaded are exclusively images, then there are other ways to load them on demand besides using Ajax, which works with content in general. But then such an approach would need to custom tailored much more than the Ajax route. Are you basically talking up DIV contents that contain nothing else but images that should be loaded only when the DIV expands?

transistor
02-28-2008, 05:01 AM
Well, if the content being loaded are exclusively images, then there are other ways to load them on demand besides using Ajax, which works with content in general. But then such an approach would need to custom tailored much more than the Ajax route. Are you basically talking up DIV contents that contain nothing else but images that should be loaded only when the DIV expands?

Yes, but my images are inside of a table. Would that still work? If not, I'll wait until Ajax feature gets added to the script.

Thanks

transistor
03-01-2008, 11:41 PM
another question, i'm using the same set up as demo 1 on http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm

is there a way to keep the content from contracting when i click it? i have one open automatically by default and i always want at least one open, so is it possible to change the code to keep the line from contracting?

ddadmin
03-02-2008, 01:43 AM
Yes, but my images are inside of a table. Would that still work? If not, I'll wait until Ajax feature gets added to the script.

Thanks

Do you mean your switch Contents consist of an entire table inside with images?


is there a way to keep the content from contracting when i click it? i have one open automatically by default and i always want at least one open, so is it possible to change the code to keep the line from contracting?

Yep, please do a search in the future first. It's discussed here: http://www.dynamicdrive.com/forums/showthread.php?t=29477

transistor
03-02-2008, 07:13 AM
Do you mean your switch Contents consist of an entire table inside with images?


Yep, please do a search in the future first. It's discussed here: http://www.dynamicdrive.com/forums/showthread.php?t=29477

Yep, the content is only a table with an image in each cell.

Thanks for the link!

transistor
03-12-2008, 04:01 AM
Hello, I was wondering if the changes have been implemented yet. Thank you.

ddadmin
03-12-2008, 07:02 AM
Not yet unfortunately. You probably will have to wait until when the Ajax feature is added to this script, since thinking about it, that's probably actually easier than trying to do a delayed fetch of a specific content type like just images instead.

transistor
06-29-2008, 06:53 PM
Just curious, will the Switch Content Script II do what I'm trying to do?

transistor
06-29-2008, 08:27 PM
Sorry, nevermind