Skip to content

Instantly share code, notes, and snippets.

@neilgee
Last active May 2, 2018 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neilgee/f5b3b6315761c3fc18decd14bb798c4f to your computer and use it in GitHub Desktop.
Save neilgee/f5b3b6315761c3fc18decd14bb798c4f to your computer and use it in GitHub Desktop.
Slide Toggle 2 Rows in BB
<ul class="list-buttons">
<li class="active"> <a id="showall">Show All</a></li>
<li><a class="showSingle" target="1">Show Classes</a></li>
<li><a class="showSingle" target="2">Show Treatments</a></li>
</ul>
<!-- Rows -->
<div id="div1" class="primary-row">...</div>
<div id="div2" class="primary-row">...</div>
jQuery(document).ready(function($){
$('#showall').click(function() {
$('.primary-row').show();
});
$('.showSingle').click(function() {
$('.primary-row').hide();
$('#div' + $(this).attr('target')).slideToggle( "slow", function() {
});
});
$( 'ul.list-buttons li' ).on( 'click', function() {
$( this ).parent().find( 'li.active' ).removeClass( 'active' );
$( this ).addClass( 'active' );
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment