Beste,
Ik ben bezig met een Categoriën script.
De bedoeling is minimaal 1 selectie of ALL aan. Zoals: http://newspulse.cnn.com/
Het is nu ook mogelijk om alles uit te hebben staan..
Hoe kan ik dit oplossen?
Ik ben bezig met een Categoriën script.
De bedoeling is minimaal 1 selectie of ALL aan. Zoals: http://newspulse.cnn.com/
Het is nu ook mogelijk om alles uit te hebben staan..
Hoe kan ik dit oplossen?
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
| function showNieuws(){ $("input:checkbox:checked").each(function(){ var cb_value = $(this).val(); if(cb_value == "all"){ $('.topic').attr('checked', false); $('.topic.alltopic').attr('checked', true); } else if(cb_value == "") { $('.topic.alltopic').attr('checked', false); } }); var ids = ""; $("input:checkbox:checked").each(function(){ var idtopic = $(this).val(); ids = ids + idtopic + ';'; }); $('#get_Nieuws').load('ajax_post.php', {topics: ids}); } $(document).ready(function(){ $('.topic.alltopic').attr('checked', true); var ids = ""; $("input:checkbox:checked").each(function(){ var idtopic = $(this).val();; ids = ids + idtopic + ';'; }); $('#get_Nieuws').load('ajax_post.php', {topics: ids}); $(":checkbox").click(showNieuws); showNieuws(); $(":checkbox").click(showNieuws); }); |