javascript - Display text under cursor - Stack Overflow

Whe mouse pointer placed on an element I want to show some text. For example if you place your cursor o

Whe mouse pointer placed on an element I want to show some text. For example if you place your cursor on upvote of an answer, it shows "This answer is useful". You can see it in below image. I did't even know how to search this.

Whe mouse pointer placed on an element I want to show some text. For example if you place your cursor on upvote of an answer, it shows "This answer is useful". You can see it in below image. I did't even know how to search this.

Share Improve this question asked Feb 13, 2015 at 3:49 gangadharsgangadhars 2,7287 gold badges44 silver badges72 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

Add a title attribute to the element. That's what's done in the image above.

<a class="vote-up-off" title="This answer is useful.">up vote</a>

If you want a custom tooltip, see this answer. You would basically use a bination of pseudo elements and custom data-* attributes. You would give the pseudo elements a content value of attr(data-tooltip) in order to access the data-tooltip attribute, for instance.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742307050a4419147.html

相关推荐

  • javascript - Display text under cursor - Stack Overflow

    Whe mouse pointer placed on an element I want to show some text. For example if you place your cursor o

    15小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信