Joe

How to show html template in Bootstrap popover?

Joe asked one year ago, 0 answers 12969 views, 0 favoured
  1. Customize popover of twitter Bootstrap. with 
     $("td").popover({            
                template:'<div class="popover"><div class="popover-inner"><h2 class="popover-title"></h2><div class="popover-content"><div></div></div></div></div>'});
  2. Allow HTML code;
     $("td").popover({        
               html:true});
<script type="text/javascript">
    $(document).ready(function () {
        $("td").popover({
            html:true,
            placement:"top",
            offset:5,
            delay:{ show:500, hide:100 },
            template:'<div class="popover"><div class="popover-inner"><h2 class="popover-title"></h2><div class="popover-content"><div></div></div></div></div>',
            title:function () {
                return $(this).html();
            },
            content:function () {
                var which = $(this).html();               
                return '<p>' + which + '</p><img src="https://www.google.com/images/nav_logo102.png">';
            }
        });
    })


</script>
© OSTree(Open Source Tree Community) | About OSTree | Advertisement | Feedback