Make bootstrap popover work with custom html template

后端 未结 3 810
暖寄归人
暖寄归人 2021-02-05 04:38

I am using an input group textbox and I need the Bootstrap 3 popover to work and the popover template should be defined &n designed by me. So the html I have currently with

3条回答
  •  南笙
    南笙 (楼主)
    2021-02-05 05:10

    you are missing the content of the popover, you'll need something like this

    $(document).ready(function () {
        var popoverTemplate = ['
    ', '
    ', '
    ', '
    ', '
    '].join(''); var content = ['
    asfaf asfsadf
    ', '
    asdf asdfasf
    ', '
    asfa
    ', ].join(''); $('body').popover({ selector: '[rel=popover]', trigger: 'click', content: content, template: popoverTemplate, placement: "bottom", html: true }); });

    Working demo

提交回复
热议问题