Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this code to add accodion effect to shopby option
- jQuery( document ).ready(function( $ ) {
- $('#narrow-by-list .accodion-main').first().addClass('active');
- $('#narrow-by-list .accodion-sub').first().addClass('active');
- $('#narrow-by-list .accodion-sub').first().css('overflow','hidden');
- $('#narrow-by-list .accodion-sub').first().data('autoHeight',$('#narrow-by-list .accodion-sub').first().height()).css('overflow','hidden');
- $('#narrow-by-list .accodion-sub:gt(0)').each(function(){
- $(this).css('overflow','hidden');
- $(this).data('autoHeight', $(this).height());
- //$(this).css('height','auto').data('autoHeight',$(this).height()).css('height','0px').css('overflow','hidden');
- $(this).css('height','0px'); //.css('overflow','hidden');
- $(this).addClass('inactive');
- });
- $('#narrow-by-list .accodion-main').click(function(){
- if ($(this).hasClass('active')){
- $(this).removeClass('active').addClass('inactive');
- $(this).next('.accodion-sub').removeClass('active').addClass('inactive');
- $(this).next('.accodion-sub').animate({height: 0},400,"swing");
- }else{
- $/*('#narrow-by-list .accodion-main').removeClass('active').addClass('inactive');
- $('#narrow-by-list .accodion-sub').removeClass('active').addClass('inactive');*/
- $(this).removeClass('inactive');
- $(this).addClass('active');
- sub = $(this).next('.accodion-sub');
- sub.removeClass('inactive').addClass('active');
- sub.animate({height: sub.data('autoHeight')},400,"swing",
- function(){
- //$(this).prev('.accodion-main').addClass('active');
- });
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement