Home › Forums › JavaScript › [Solved] Jquery switch view modes without refresh › Re: [Solved] Jquery switch view modes without refresh
January 25, 2011 at 1:37 pm
#64024
thierryeamon
Member
ok that’s not entirely what I ment… sure now I can toggle using two links but now I can also see them both, none or one of the two. So if I toggle the list div, I want the grid div to automatically hide (or vice versa).
If I do something like this, both links have the same functionality, that just doesn’t make sense ;-)
$(document).ready(function(){
$('#toggle-grid').click(function(){
$('#grid').toggle();
$('#list').toggle();
});
$('#toggle-list').click(function(){
$('#list').toggle();
$('#grid').toggle();
});
});