0

This may be a vague question. I have a page with 3 tabs using bootstrap's tabs. Within the tab's contents there are click events. Some jQuery, some using knockout's click binding, and one using onclick. When I first go to any tab everything works fine. When I leave that tab to go to another tab and then return, none of the click events work anymore except the one made with onclick. At first I thought it was knockout causing something to go haywire, but I commented out the knockout code and it still happens. The events are pretty basic:

$('#prodSalesTable').on('click', 'td.control', function (e) {
    ....
}

Here's the tab init code. Again, basic.

$('#productDetailTabs a').click(function (e) {
   e.preventDefault();
   $(this).tab('show');
});

Tab code:

<ul id="productDetailTabs" class="nav nav-tabs" data-tabs="tabs">
    <li class="active"><a data-target="#informationTab" data-toggle="tab">
        INFORMATION</a></li>
    <li><a data-target="#vocTab" data-toggle="tab">
        VOC</a></li>
    <li><a data-target="#htsCountrySpecTab" data-toggle="tab">
        TARIFF CODE</a></li>
</ul>
<div class="tab-content">
        <section id="informationTab" class="tab-pane active">....</section>
        <section id="vocTab" class="tab-pane">....</section>
        <section id="htsCountrySpecTab" class="tab-pane">....</section>
</div>

Any ideas?

1 Answer 1

0

I don't know why this fixed it, but on the tab links I changed data-target to href and it now no longer seems to delete the click events.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.