views:

87

answers:

2

Hi - I'm using the jQuery tooltip plug in on an image map. When a part of the image is hovered over, the tip appears. This is activated with the following code:

$(function() {
$("map > area").tooltip({ positionLeft: true });
});
</script>

The html for the image map is set up like this:

<map name="Map"> 
  <area shape="rect" coords="36,466,64,507" href="link.aspx" alt="Alt Title" title="ToolTip Title" /> 
  <area shape="rect" coords="36,466,64,507" href="link.aspx" alt="Alt Title2" title="ToolTip Title2" /> 
</map>

I'd like to have one of the tool tips be in the active (or hovered) state when the page first loads. I'm having a hard time figuring out how to do this, or if it is even possible.

Has anybody used this plugin and have any ideas of how I could implement this feature?

+1  A: 

When the page is finished loading you can trigger the mouseover.

$("[name='Map']").trigger("mouseover");
John V.
Wouldn't that trigger all of the tool tips? I would like to be able to set one of the area's to active like:<area shape="rect" coords="36,466,64,507" href="link.aspx" alt="Alt Title" title="ToolTip Title" class="active" />So this tool tip will default to thinking it's in the hover state.
Peachy
A: 

You could focus mouse on preferable part of the map or trigger event (probably hover) that activates tooltip.

Klaster_1