Excluding hidden elements from serialize
I have situation like this:
<ul id='sortme'>
<li class='sortitem' id='bild_0.jpg'><img alt='img'src='0.jpg'/><a
href='#' class='delete'>X</a></li>
<li class='sortitem' id='bild_1.jpg'><img alt='img'src='1.jpg'/><a
href='#' class='delete'>X</a></li>
<li class='sortitem' id='bild_2.jpg'><img alt='img'src='2.jpg'/><a
href='#' class='delete'>X</a></li>
</ul>
Javascript code is
$("#sortme").sortable({
revert: false,
scroll: true,
update : function (sorted) {
serial = $('#sortme').sortable('serialize');
$.ajax({
url: "bildersort.php",
type: "POST",
data: serial,
success: function(feedback){ $('#data').html(feedback); }
});
}
});
$(".sortitem .delete").click(function(){
$(this).parents(".sortitem").hide("slow");
});
Problem is that if i hide item by clicking on X, that item is not
excluded from serialize function. Is there a way to exclude all items
that have display:none?
Hope I managed to explain, because my english is not perfect :)