Bootstrap tooltips not working

前端 未结 25 1735
孤城傲影
孤城傲影 2020-11-28 17:46

I\'m going mad here.

I\'ve got the following HTML:



        
25条回答
  •  一整个雨季
    2020-11-28 18:40

    Tooltip and popover are NOT only-css plugins like dropdown or progressbar. To use tooltips and popover, you MUST to activate them using jquery (read javascript).

    So, lets say we want a popover to be shown on click of an html button.

    button
    

    Then you need to have following javascript code to activate popover:

    $('.popovers-to-be-activated').popover();
    

    Actually, above javascript code will activate popover on all the html elements which have class "popovers-to-be-activated".

    Needless to say, put the above javascript inside DOM-ready callback to activate all popovers as soon as DOM is ready:

    $(function() {
     // Handler for .ready() called.
     $('.popovers-to-be-activated').popover();
    });
    

提交回复
热议问题