I've got a button that switches between grid view and list view, the script is able to switch the styling no problem but when going to page 2 (pagination) the view returns back to list view. How can I get the views to remain when using pagination? Here is my JS script. I can also provide more info if asked.
$('button').click(function(e) {
if ($(this).hasClass('grid')) {
$('#container ul').removeClass('list').addClass('auto-grid');
}
else if($(this).hasClass('list')) {
$('#container ul').removeClass('auto-grid').addClass('list');
}
});