dynamic tabs that worked in Bootstrap 2 don't work in Bootstrap 3 -
i've used following in bootstrap 2.1 when try use in bootstrap 3, dynamic content isn't loaded.
can suggest fix?
thanks
<script type="text/javascript"> $(function() { $("#maintabs").tab(); $("#maintabs").bind("show", function(e) { var contentid = $(e.target).attr("data-target"); var contenturl = $(e.target).attr("href"); if (typeof(contenturl) != 'undefined') $(contentid).load(contenturl, function(){ $("#maintabs").tab(); }); else $(contentid).tab('show'); }); $('#maintabs a:first').tab("show"); }); </script>
and
<ul id="maintabs" class="nav nav-tabs"> <li><a data-target="#tab1" data-toggle="tab" href="a">tab 1</a></li> <li><a data-target="#tab2" data-toggle="tab" href="content-test.php">tab 2</a></li> <li><a data-target="#tab3" data-toggle="tab" href="tab-calendar.php?siteid=201">tab 3</a></li> </ul>
try using....
$("#maintabs").bind("show.bs.tab", function(e) {
instead of...
$("#maintabs").bind("show", function(e) {
although of jquery 1.7, .on()
preferred method attaching event handlers.
$("#maintabs").on("show.bs.tab", function(e) {
Comments
Post a Comment