简体   繁体   中英

Styling a default tooltip

Using jQuery, I have implemented tooltip in my html. Now I want to style my tooltip.

How can I do that?

My JavaScript code for the tooltip is this:

$('.bootstrap-switch-handle-on').hover(function () {
    $(this).css('cursor', 'pointer')
           .attr('title', 'This is a hover text.');
}, function () {
    $(this).css('cursor', 'auto');
});

Thanks

It looks like you are just adding the title attribute to the .bootstrap-switch-handle-on element. The subsequent "tooltip" is generated by the browser and cannot be styled. If you are using Bootstrap, you can use their built in Tooltip which can be styled with CSS. http://getbootstrap.com/javascript/#tooltips

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM