1

The following code is not working even after the required JS files are loaded. There is no error thrown. I'm doing this because the codemirror codepane does not directly load the code when there are tabs present in a page. Any fix?

$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
    console.log("Tab Shown");
    $('.CodeMirror').each(function (i, el) {
        el.CodeMirror.refresh();
    });
});
Ninjakannon
  • 3,751
  • 7
  • 53
  • 76
Karthik A
  • 11
  • 1
  • @JqueryKing http://stackoverflow.com/questions/20705905/bootstrap-3-jquery-event-for-active-tab-change – A. Wolff May 26 '15 at 13:51
  • @A.Wolff - Oh i newly learned – Sudharsan S May 26 '15 at 13:53
  • Are the tabs being inserted or replaced at any point? If the elements are being altered, the selector may not be finding them or may find previous instances that are no longer in the page. You may need to [delegate the event binding](http://stackoverflow.com/questions/8110934/direct-vs-delegated-jquery-on). – Jonathan Lonowski May 26 '15 at 13:59
  • The code you've included [works just fine](http://www.bootply.com/iNqWXTQ2QL). The problem lies elsewhere. – Ted May 26 '15 at 15:28

0 Answers0