Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript [Solved] Jquery switch view modes without refresh Re: [Solved] Jquery switch view modes without refresh

#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();
});
});