2
As trivial as it may seem I’m having trouble executing this script, the problem I have is this, when entering a page I show a div with selected content from my database and this is being done correctly, From then on the user has the option to show this information in a Grid or in a List, I created a radio with two options, Grid and List and I am trying to hide the first div that is shown when entering the page when one of these options is selected. What I’ve done so far is this:
$(window).load(function(){ $(':radio').change(function (event) { var id = $(this).data('id'); $('#' + id).addClass('none').siblings().removeClass('none'); if ((id == "lista") || (id == "grid")) { document.getElementById('geral').style.display="none"; } }); });
The divs are like this:
<div id="geral">
Geral Mostra ao entrar na página
</div>
<div id="lista" class="none">
Lista, mostra ao selecionar Lista no radio
</div>
<div id="grid" class="none">
Grid, mostra ao selecionar Lista no radio
</div>