I have the same problem, but Alex's solution doesn’t work for me, since my tab cover does not have a fixed height, so a space under the first tab will be displayed on first load.
Thành Nguyễn's solution works for me. Basically, it updates the slider every time you click on the navigation tab, so LightSlider will be able to calculate the height of the active container.
Here's the full script:
$(document).ready(function() {
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
$('#slider-2').lightSlider({
item:4,
loop:false,
slideMove:2,
pager: false,
easing: 'cubic-bezier(0.25, 0, 0.25, 1)',
speed:600,
responsive : [
{
breakpoint:480,
settings: {
item:2,
slideMove:1
}
}
]
}).refresh();
});
});
source
share