Easy responsive tabs - is a lightweight jQuery plugin which optimizes normal horizontal or vertical tabs to accordion on multi devices like: web, tablets, Mobile (IPad & IPhone). This plugin adapts the screen size and changes its action accordingly.
If you close opened accordion and then resize window, the last active accordion will be opened again and if you try to close it, it will close and then opens. This happens becouse the author remove attribute from tabs
on line 217
$respTabs.find('.resp-accordion-closed').removeAttr('style');
To fix this all you have to do is to check window width, if it's more than the brakpoint when tabs becomes accrodion.
in my case this breakpoint eqauls to 767px, so i check it like this
$(window).on('resize', function () {
if ( $(window).width() > 767 ) {
$respTabs.find('.resp-accordion-closed').removeAttr('style');
}
});
If you close opened accordion and then resize window, the last active accordion will be opened again and if you try to close it, it will close and then opens. This happens becouse the author remove attribute from tabs on line 217 $respTabs.find('.resp-accordion-closed').removeAttr('style');
To fix this all you have to do is to check window width, if it's more than the brakpoint when tabs becomes accrodion. in my case this breakpoint eqauls to 767px, so i check it like this $(window).on('resize', function () { if ( $(window).width() > 767 ) { $respTabs.find('.resp-accordion-closed').removeAttr('style'); } });