jeudi 15 janvier 2015

HTML - Hide a tag and img if the checkbox is not checked

i have some checkboxes in an overlay and as long as they ar not checked the img and the a tag should not be seen.


This is the a tag and the img:



<div id="extra">
<a href="detail.html?event=theater&datum=01_01" class = "theater"><img src="img/theater.png" alt="Theater"></a><img src="img/literatur.png" alt="Literatur">

</div>


This is the Checkbox:



<div class="tags">
<label>
<input type="checkbox" rel="alles" id="checkme"/>
Alles
</label>
</div>


And this is the function:



$("#extra").css("display","none");
$("#checkme").click(function(){
if ($("#checkme").is(":checked"))
{
$("#extra").show("fast");
}
else{
$("#extra").hide("fast");
}
});


I also tried some other ways but nothing helped :/


Thanks in advance





Aucun commentaire:

Enregistrer un commentaire