开发者

How to Get a Tooltip to Stick

I've implemented dojo tooltips and it works find for my basic needs. What I would like to do is something very similar to Facebook and ancestry.com where hoovering over some text开发者_运维百科 brings up a tooltip window that you can move the mouse into and click on it's content. Is there a javascript framework out there that supports this? Is it just some form of a drop down menu? I'd prefer to do it in dojo if possible.

Thanks, Curt


Several different versions of jQuery / Javascript tooltip plug-ins typically have a property regarding when to hide the tooltip. According to Dojo's Documentation - if you are looking for a tooltip that you can mouse into and use content within the tooltip, they recommend using dijit.TooltipDialog.

Documentation on that can be found here:

http://docs.dojocampus.org/dijit/TooltipDialog


I ended up using the Spry tooltip. Given I use Dreamweaver, I should have looked there first. It was more work than others as I had to craft my own CSS to get a nice look to the popup frame. The frame placement is not as accurate as the Dojo tooltip. It is also always displayed below the trigger. What I like about it is that you can set the time before it appears on mouse over and how long it's displayed after leaving. The text that appears in the tooltip is in the html as a div. This works well for me as my tooltips are footnotes and subject to change. It also makes it easier to format the contents. I've yet to add a link to any of them, but I don't see why it shouldn't work.

The code skeleton is also inserted automatically through the use of Dreamweaver insert. I've had minor problems with some of the inserts, but they always work on the second attempt. I also end up cleaning up the code after adding several tooltips. Each tooltip is surrounded by script delimiters and placed at the bottom of the html file. I collapse them into a single set of delimiters. I'll eventually move them to a separate file.

One concern is future support for Spry. I've seen a lot of complaints about it not being updated on the Adobe forum and a response from what appears to be the sole remaining developer that he's working on it. If it comes to it, I can work on it myself as it's a standalone module.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜