开发者

Getting jQuery tooltip to have a tip start as active when page first loads

开发者 https://www.devze.com 2023-01-10 01:43 出处:网络
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:

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 });
});

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

<m开发者_Go百科ap 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?


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

$("[name='Map']").trigger("mouseover");


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

0

精彩评论

暂无评论...
验证码 换一张
取 消