Closed ghost closed 6 years ago
You need to bind the getState
into a window resize:
var $tabs = $('.foo-tabs').responsiveTabs();
$(window).resize(function(){
console.log($tabs.responsiveTabs('getState')); // returns tabs || accordion
});
It's a shame there isn't an event fired off when there is a change in state
EDIT
My bad there is an event
$tabs.on('tabs-activate-state', function(event, state){
var old = state.oldState;
var new = state.newState;
});
Thanks @coxrichuk
Hello,
For better styling, I would like to add classes to the parent element depending on the mode of the tabs (tabs or accordion).
I saw that "activateState" callback function, but I don't know how to detect if we are in accordion or tab mode in order to give the correct class to my element.
Could you please point me the right direction ?
Thanks
Alex