Skip to content Skip to sidebar Skip to footer

How To Add An Image To Tool Tip Using Javascript?

How can I show an image as a tool tip in my web page. I want my tool tip in a custom image, rather than the usual one. I tried defining a class to hold the image and added the clas

Solution 1:

If you mean you want to style the tooltip you'll need to use javascript to create the functionality. What script you use depends on what JS framework you're using, if any.

There's a big list of tooltips on this site : http://www.1stwebdesigner.com/css/stylish-jquery-tooltip-plugins-webdesign/

Uses different frameworks, so pick the one that works for you.

Solution 2:

I would use a common library like jQuery. There are a lot of running examples: http://jquery.bassistance.de/tooltip/demo/

Solution 3:

Browsers don't support rich tooltips but it can still be done

The easiest way is to use some plugin (if you're using something like jQuery) that provides rich tooltips functionality. Browsers can only display text that's defined in alt attribute (of image elemnt) or title attribute in any other HTML element (including image).

This will get you started on jQuery tooltip plugins.

Post a Comment for "How To Add An Image To Tool Tip Using Javascript?"