Skip to content

Instantly share code, notes, and snippets.

@kamalinfo
Created December 29, 2017 04:16
Show Gist options
  • Save kamalinfo/c57b2cc9f0723d779797126e69bd5ca4 to your computer and use it in GitHub Desktop.
Save kamalinfo/c57b2cc9f0723d779797126e69bd5ca4 to your computer and use it in GitHub Desktop.
<div class="product-tablist">
<ul class="tab-style">
<li class="active" data-view="grid-view"><i class="fa fa-th"></i></li>
<li data-view="list-view"><i class="fa fa-th-list"></i></li>
</ul>
</div>
//add archive product
<div class="product-bottom-area grid-view clearfix">
add js file
/* Product Grid & List view */
$('.tab-style > li').on('click', function(){
var proView = $(this).data('view');
$('.tab-style > li').removeClass('active');
$(this).addClass('active');
$('.product-bottom-area').removeClass('grid-view list-view').addClass(proView);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment