In action: http://3.alphenweer.nl/weer/
Code:
$(document).ready(function(){
$('.categorie[data-cat]').click(function(){
$('#cat-'+ $(this).attr('data-cat')).slideToggle('slow');
});
});
<span class="categorie" data-cat="nieuws">Nieuws</span>
<div class="box" id="box-nieuws">
<a href="/pages/nieuws/nieuws/alphen.php">Alphen</a>
<a href="/pages/nieuws/nieuws/nederland.php">Nederland</a>
</div>
Problem: When i click on a menu button (In the example: click on ‘Neerslag’ or ‘Satteliet’) nothing happens. I think the selector isn’t correct, but it should be. Can you guys help me?
Already found the problem:
In the third line,
$('#cat-'… should’ve been$('#box-'