0

I want a very dynamic and simple tool-tip feature in my web app (very much like Facebook's). I have looked around at all the jQuery plugins but don't fancy them really, so want to build my own. It needs to be able to display lists as well as single items on hover of certain html elements.

My main question is that is it best to build the html tooltip element in jQuery and then insert into the DOM every time a relevant element is hovered, or have one tool-tip to serve all tool-tip hover activity and just move it around and change the content inside it?

Any tool-tip experience would be of interest!

1
  • 4
    I'd say, try the easy way first and see if it is sufficient. Commented Jun 21, 2011 at 9:44

3 Answers 3

2

Well.. You have 2 options:
1) Generate a tooltip every time you need to show it, but don't forget to remove it from DOM, after hide.
2) But IMHO best way is to initialize tooltip only once, and then just position it at right place, modifying its contents.

Sign up to request clarification or add additional context in comments.

Comments

1

Try tipsy tooltip jquery plugin

http://fishintheriver.com/2009/03/04/a-cool-facebook-style-tooltip-plugin-for-jquery/

But if you wanna do it by yourself then i think 2nd option is good "have one tool-tip to serve all tool-tip hover activity and just move it around and change the content inside it"

Comments

0

I ended up constructing and removing a new tooltip instance on each mouseenter/mouseleave. Works really well!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.