jquery - twitter bootstrap tooltip not working in js template -
i ma using twitter bootstrap tooltip functionality works fine in gsp header texts. want add bootstrap tooltip on id="tooltipcheck". if write title="{{data}}" see tooltip bootstrap tooltip not seem work here. there issue js template or there else?
<script id="mytemplate" type="text/x-handlebars-template"> <div class="row"> <div class="span4" id="tooltipcheck" data-placement="bottom" data-toggle="tooltip" data-original-title="{{data}}">{{data}} </div> </div>
i calling tooltip this.
<script> jquery(function ($) { $("#tooltipcheck").tooltip('show'); });
you can't set id of element in template because id's need unique. try changing tooltipcheck
class instead:
<div class="span4 tooltipcheck" data-placement="bottom" data-toggle="tooltip" data-original-title="{{data}}">{{data}} </div>
and initialize tooltips using class:
$(".tooltipcheck").tooltip('show');
the tooltips need initialized after handlebars has parsed template , generated markup, or else tooltips won't have elements bind to.
Comments
Post a Comment