Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript/CSS Tooltip that you can hover over and click

I'm looking for a javascript/css tooltip that can do the following:

  1. Shows up when you hover over some page element (such as a help icon.)
  2. Repositions itself based on the browser window (for example if it's on the far right of the page, it will show itself to the left of the page element, otherwise it'll show to the right of it. That way it won't go off of the page.)
  3. You can hover over the tooltip and it won't disappear. This way you can select text or click on a hyperlink within the tooltip.

I'm using dojo but their dijit tooltip seems to be very inflexible, as it can only spawn off of another dijit element, most commonly a dijit button. I'd rather not having to reference a whole other javascript framework like jquery or prototype so hopefully someone has a way to do this using just one basic script.

like image 262
Justin Avatar asked Feb 11 '26 20:02

Justin


1 Answers

Unfortunately for you, the tooltip style plugins available for Dojo are nowhere near the other frameworks (namely: jQuery). Because of this, you have three options:

Reinvent the wheel. Take what you learned from other tooltip scripts and build your own from scratch. This option takes the longest development time (and in the inevitable maintenance of cross-browser bugs).

Extend an existing plugin. You can take a current tooltip plugin for dojo (or perhaps a library agnostic plugin) and extend its functionality by adding your own scripts to it.

Use jQuery. This has already been said twice by others, but let me say it again. jQuery has a thriving plugin ecosystem, and if development/maintenance times are truly important to you, then jQuery should definitely be considered.

like image 50
Moses Avatar answered Feb 13 '26 10:02

Moses



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!