Created
December 2, 2014 11:45
-
-
Save rameshanandakrishnan/0c30b6ed6fcd153efac2 to your computer and use it in GitHub Desktop.
Vertical Slider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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