juliya
11/28/2017 - 1:50 PM

bootstrap tabs

<ul class="nav nav-tabs tabs tabs-">
    <li class="tabs-item active">
        <a href="#" data-toggle="tab"></a>
    </li>
    <li class="tabs-item">
        <a href="#" data-toggle="tab"></a>
    </li>
</ul>
<div class="tab-content">
  <div id="" class="tab-pane fade in active"></div>
  <div id="" class="tab-pane fade"></div>
</div>

$('a[href="#departments"]').one('shown.bs.tab', function (e) {
    $('#js-departments-slider').bxSlider({
        pagerCustom: '#js-departments-pager',
        adaptiveHeight: false,
        nextText: '',
        prevText: ''
    });
});

//tabs url
    var url = document.location.toString();
    if (url.match('#')) {
        $('.nav-tabs a[href="#' + url.split('#')[1] + '"]').tab('show');
    }
    $('.nav-tabs a').on('shown.bs.tab', function (e) {
        window.location.hash = e.target.hash;
        var top = $(e.target.hash).offset().top - 120;
        $('html, body').animate({scrollTop: top}, 300);
    })