Tuesday, 12 January 2016

Switch list/grid view using jQuery


list_grid_switch_jquery.jpg

Hi all, Below is an example of switching between list and grid view using jQuery.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script> $( document ).ready(function() { $('.show-list').click(function(){ $('.wrapper').addClass('list-mode'); }); $('.hide-list').click(function(){ $('.wrapper').removeClass('list-mode'); }); }) </script>

If you want to use such switching between list and grid view as shown in above example then, follow/use the below scritp and html code.
Script:-
  1. $( document ).ready(function() {
  2.   $('.show-list').click(function(){
  3.   $('.wrapper').addClass('list-mode');
  4. });
To view the full blog about Switch list/grid view using jQuery please visit Findnerd.

For such more technology related Blogs like HTML, Javascript, Phonegap,iOS, Android, Mysql you can also visit Findnerd.

No comments:

Post a Comment