PDA

View Full Version : Rich HTML Balloon Tooltip - prevent browser preloading



gordonlips
12-20-2009, 10:21 AM
1) Script Title: Rich HTML Balloon Tooltip

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex5/balloontooltip.htm

3) Describe problem: Is it possible to only load in the div content on the mouseover event? Let's say there were a large amount of tooltip divs on the page, like 50, and those divs each contained a 400x400 image- the page would take forever to load for content the viewer may choose not to even mouseover. So the essential question- can I make hidden divs truly hidden and disabled to prevent the browser downloading everything at once?

jscheuer1
12-21-2009, 03:08 AM
The images are not preloaded. They are ordinary HTML content, just unseen. As such they load as the page loads, just like images that you can see.

I'm not sure if there is any good solution to this without some elaborate scheme to hold back the loading of the images and to show a loading image when they are needed. Without something like that, you will see nothing or see the broken image token, while they load.

Something like Lazy Load:

http://www.appelsiini.net/projects/lazyload

which, by its own admission, doesn't work across all browsers. In addition to the problems mentioned on the site for this script with Safari, it appears that Opera also will not delay the loading.

The thing is, once you put an image on the page, the browser is going to try to load it. If you have a different sort of tip script, one where the content for the tip is not already on the page as part of its HTML, like:

http://www.dynamicdrive.com/dynamicindex4/imagetooltip.htm

Then things would be different, but that script doesn't have the cool pointer image for its tips, and with images as large as what you say you have, there would be lag time while the image was loading as mentioned in the second paragraph of this message.

It probably could all be worked out, but it would be almost like writing an entirely new script.

gordonlips
12-21-2009, 12:03 PM
Lazy Load looks like a solution considering the worst that can happen is it loads as normal. If the risk was it not loading at all, then there would be an issue.