Adding custom class to tooltip

后端 未结 8 975
一生所求
一生所求 2021-02-05 02:04

I want to style(css) some bootstrap-tooltip.js tooltips, without affecting all the tooltips. I have tried many different solutions but i allways end up adding a class to the ele

8条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-05 02:38

    Maybe this can help someone like it helped me:

    Add a Custom class to your "generated" tooltip node:

    $(document).ready(function() {
        $(".my-class").tooltip({
            tooltipClass:"my-custom-tooltip"
        });
    });
    

    Sample output as last child of body element:

    
    

    Applied to this questions logic:

    $(function(){
      $("[id$=amount]").tooltip({
        trigger: 'manual',
        placement: 'right'
        tooltipClass:'test'
      })
    }); 
    

    Tested using jQuery UI - v1.10.3

提交回复
热议问题