Setting functions to Events in Explorer fails.
The code below is part of a tool tip set of functions. Currently this fails in Explorer as soon as it tries to set the event handlers to an instance of the functions. So in this case "initToolTipElements" is only printed once to the alert box and then the script stops. The code works fine in Firefox.
This is the doc type to the HTML page.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Can any one tell me where to look for the problem?
//Looks like this is only being run once in explorer.
what kind of elements (what tags) are those with the name="toolTip"?
Thanks for responding. I have two tests running. One is what I'm aiming at which is an <area> tag
and the other is this test that is on line.
<map name="EarthMap_600_imageMap_Map" id="EarthMap_600_imageMap_Map">
<area shape="rect" coords="70,86,95,103" href="#" alt="BritishColumbia" name="toolTip" toolTip="British Columbia"/>
When the mouse is over the blue rectangle it should pop up a simple tool tip.
Thanks for any help that you can provide.
First: the name attribute is not to be used upon all the HTML elements. In fact, for the modern browsers and under the last Doctype versions, there are only several elements which can bear a name (and which are to be found on using DOM getElementsByName() method. <AREA> is not one of them.
Ah I see, OK so is there a getElementsByTitle function in JS? If now how would I go about collecting all the elements with a known title? Would this require a recursive function and go through all tags in the body and collect them?
Is there no more advise on this?
I think he's referring to this
<Div title="this could be your tool tip">Put your mouse here</Div>
Put that on a page and see what it does
Thanks, I didn't know about those tool tips how ever that is not what I'm looking for in the final product. I really do need to use JS to get more data into a nicely formated popup that tracks the mouse.
What I have works, just not in IE, so I gather that I need to find another way to collect the correct tags that will get the popups.
What I have is a parameter in any given tag that is called toolTip="someName" and I use that property value to display the correct information.
At the moment I'm looking at writing a recursive function that will search the page for any tab with a toolTip property. Is that the best way to go about doing that? The tag could be a div, an area, or other.
So can you tell me why this recursive function doesn't continue. It only runs down the first branches and stops and does not continue after that.
Thanks for the help, here is what I was shooting for and so far it is working on several browsers correctly. It is the map section of the site that now has nice little pop ups to display the clientele in that area.
If any one sees any problems in any browser please let me know. I don't care about old browsers as any one coming to our site will be on the latest machines and software as a two year old machine is way out of date for us.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)