bootstrap-tabcollapse icon indicating copy to clipboard operation
bootstrap-tabcollapse copied to clipboard

Add option to set a breakpoint to determine when the tabs switch to an accordion

Open mknabe opened this issue 10 years ago • 8 comments

Added a breakpoint option to determine when tabs switch to an accordion instead of using CSS classes. The plugin was breaking for me (on the is(':visible') check) when the element was inside of a flexbox element and this was my solution.

Example usage:

$('#myTab').tabCollapse({
  breakpoint: 720
});

This would cause the tabs to be displayed when the screen is greater than or equal to 720px and the accordion when the screen is less than 720px.

mknabe avatar Jul 10 '15 21:07 mknabe

so you add this to your modified bootstrap?

clydebaron2000 avatar Jul 26 '16 18:07 clydebaron2000

is(':visible') isn't a very reliable check. This solution would work for everyone

mknabe avatar Jul 26 '16 18:07 mknabe

oh and the $('#myTab').tabCollapse({ breakpoint: pixel# }); goes in the main js right

clydebaron2000 avatar Jul 26 '16 18:07 clydebaron2000

Correct

mknabe avatar Jul 26 '16 18:07 mknabe

is the collapsing element still in a flexbox?

clydebaron2000 avatar Jul 26 '16 19:07 clydebaron2000

Yes? I'm not exactly sure what you're asking... the element doesn't move

mknabe avatar Jul 26 '16 19:07 mknabe

are the tab(s) that use .tabCollapse in a flexbox?

clydebaron2000 avatar Jul 26 '16 19:07 clydebaron2000

Yes

mknabe avatar Jul 26 '16 19:07 mknabe