PDA

View Full Version : Rich HTML Balloon Tooltip Load First on Page?



croceldon
08-10-2008, 07:46 PM
1) Script Title:

Rich HTML Balloon Tooltip

2) Script URL (on DD):

http://www.dynamicdrive.com/dynamicindex5/balloontooltip.htm

3) Describe problems:

This script is working fine for me - I'm using it provide a hover menu interface for my site.

My question is: Is it possible to control when exactly the tooltip is loaded by the browser. We have some web user tracking software that downloads an image for every page on our site. The problem is that the tooltips don't appear when they should until after everything else on the page (including the tracking image) loads.

Is there a way to force the tooltips to load first?

Thanks

Jason

Nile
08-10-2008, 07:50 PM
Can we see the page with the problematic code please? That will give us an idea of how its placed and how it should be placed.

croceldon
08-10-2008, 08:04 PM
Sure - http://newsite.farrapc.com/about-us is one example, but it could be any page on the site. When you hover over the Products and Applications buttons at the top, you'll see the tooltip appear, but it won't appear until everything else is loaded.

BTW, the problem is only visible from IE, not FF. This is because the tracking script/image only works in IE.

Thanks!

Nile
08-10-2008, 08:08 PM
So the drop down menu is the tooltip? I don't think that its the best place to put a tooltip, try using one of the following:
http://www.dynamicdrive.com/dynamicindex1/anylinkcss.htm
http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/index.htm

TheJoshMan
08-10-2008, 08:13 PM
I would have to agree with Nile, it's not technically a "submenu" script. It's more for when someone hovers over a link to give a bit more description... However, this is an interesting way of using it. Can't say that I've seen anyone else do it this way.

But Nile is right, the best bet (and the most expandable) would be to use an actual "menu" script.

croceldon
08-10-2008, 08:20 PM
Guys, thanks for your help, but I really need to stick with the tooltip. There aren't going to be any further submenus, so the fact that it's not really expandable isn't an issue for me at this point.

I found this script the easiest to integrate with our site's considerable css demands, so I don't think switching would be the best thing.

Is there a way to control the timing of when the tooltip's loaded?

Thanks,

Jason

Nile
08-10-2008, 08:30 PM
Find this in the code:


if (window.addEventListener)
window.addEventListener("load", initalizetooltip, false)
else if (window.attachEvent)
window.attachEvent("onload", initalizetooltip)
else if (document.getElementById)
window.onload=initalizetooltip

And replace it with this:


initalizetooltip();


I don't know if it will work.
But I hope it does,
Nile

croceldon
08-10-2008, 08:39 PM
Nile,

Thanks for the response.

I don't think it worked. The tooltip still displays fine, but it doesn't appear until all other items on the page are loaded.

Thanks,

Jason

Nile
08-10-2008, 08:41 PM
I did a little testing by making my own little code:


<script type="text/javascript">
var deter;
function seeThro(){
return ((deter) ? "true" : "false");
}
window.onload = function(){
deter = true;
}
window.onclick = function(){
if(deter){
alert("True");
}
else {
alert("False");
}
}
alert(seeThro());
</script>
<img src="http://www.astro.uio.no/ita/artikler/tema/new_horizons/images/JupiterIo010807.jpg" />
<img src="http://www.columbia.edu/itc/mealac/pritchett/00maplinks/overview/world2003/world2003.jpg" />

That test was positive(it worked as planned).

In your case I really don't think that there's away to get it to work before onload. I'm sorry. Was there a specific reason why you needed it to work before onload?

croceldon
08-10-2008, 08:46 PM
Thanks so much for all the work you put into this!

The reason I need it is because our team's afraid that a user won't even know they can select one of these 'dropdown tooltips', since they won't appear until all page content is loaded - which could take awhile b/c of the tracking image that I mentioned.

Nile
08-10-2008, 08:52 PM
Why don't you put a little + next to the ones with the dropdown?

TheJoshMan
08-10-2008, 09:33 PM
I think I wouldn't worry TOO much about that, because the page is well optimized. The images aren't horrendous, and it's pretty well organized. I cleared my cache and realoaded the page three or four times with an average load time of about 4 seconds. I even tuned down my download speed a little and it didn't even hit 10 secs. If a visitor were to leave the site within 10 seconds of first arriving because they didn't think there was anywhere else to go... They are definitely impatient, and much quicker to glance over ALL the content than I am.