Skip to content

Instantly share code, notes, and snippets.

@rameshanandakrishnan
Created December 2, 2014 11:45
Show Gist options
  • Save rameshanandakrishnan/0c30b6ed6fcd153efac2 to your computer and use it in GitHub Desktop.
Save rameshanandakrishnan/0c30b6ed6fcd153efac2 to your computer and use it in GitHub Desktop.
Vertical Slider
var tcc = {};
//VerticalAccordion component
tcc.component = function(ele){
return{
//verticalAccordion
verticalSlider : function(e){
$(e).click(function(event){
var parent = $(event.target).parent();
parent.toggleClass(" active").find("> ul").slideToggle();
});
}
}
}();
$(document).ready(
function() {
'use strict';
//verticalAccordion
//add the id or the class of the wrapper in the array to use this feature
var VerticalSliderAry = ["#js-slider-container"];
$.each(VerticalSliderAry, function( index, value ) {
tcc.component.verticalSlider(value);
});
}
);
////////////////////////////////////////Mark up////////////////////////////////////////////////
<div id="js-slider-container">
<div class="vendor js-slider-item">
<h3>Vendors</h3>
<ul>
<li class="active-filter">
{{ vendor }}
</li>
<li>
{{ vendor | link_to_vendor }}
</li>
</ul>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment