<script type='text/javascript'>$(document).ready(function(){
$('input[type=checkbox]').click(function(){
$('input[type=button]').attr('disabled', !$('input[type=checkbox]:checked').length);
});
$('#mark_all').click(function(){
$(':checkbox').attr('checked', true);
$('input[type=button]').attr('disabled', !$('input[type=checkbox]:checked').length);
});
$('#unmark_all').click(function(){
$(':checkbox').attr('checked', false);
$('input[type=button]').attr('disabled', !$('input[type=checkbox]:checked').length);
});
$('#mark_read').click(function(){
$('input[type=button]').attr('disabled', !$('input[type=checkbox]:checked').length);
});
<!--
// HERE IS WRONG
var przeczytanych = 0;
$(':checkbox').each(function () {
if (przeczytany(this)) {
przeczytanych++;
$(this).attr('checked', true);
} else {
$(this).attr('checked', false);
}
});
$('#button').attr('disabled', przeczytanych > 0);
// HERE ENDS WRONG
-->
jak oznaczyc "przeczytane" posty? moze jakas klasa? czy cos?
jak to zrobic?
nie bardzo rozumiem ten kod "przeczytanych"; jak go oznaczyc?