Configuring boot content

The boot pop-up stream expects this:

<a href="#" id="example" class="btn btn-danger"  rel="popover" data-content="It so simple to create a tooltop for my website!" data-original-title="Twitter Bootstrap Popover">hover for popover</a>  

$("#example").popover({placement:'bottom'});

      

.. expects you to define the data content in a template, or dynamically pass it to jquery.

In any case, it can support the format as shown below:

.. point capable of specifying content / title in blocks

<div id="example">
<div class="original-title">
Twitter Bootstrap Popover
</div>
<div class="data-content">
It so simple to create a tooltop for my website!
</div>
<a>hover for popover</a>
<div>

$("#example").popover({placement:'bottom'})

      

+3


source to share


2 answers


Currently not, as the popover script basically extends the functionality of the popover script, but nothing is impossible. You can change the script and add a custom one data-attributes

to support your markup yourself, but then when updates come you will have to do it again if you want to maintain your changes or not update at all.



+1


source


I think it is possible using javascript code to provide the content of these divs to elements, but not recommended.



$("a").attr("data-title",$(".data-title").html()).attr(".data-content",$(".data-content").html());
$('a').popover({placement:'bottom'})

      

+1


source







All Articles