Spinner на jquery
1 +
- шт.
$('.counterUp').click(function() {
var tmParent = $(this).parent("td").parent('tr');
var count = tmParent.children('td').children('span').html();
count++;
tmParent.children('td').children('span').html(count);
return false;
});
$('.counterDown').click(function() {
var tmParent = $(this).parent("td").parent('tr');
var count = tmParent.children('td').children('span').html();
if (count > 1) {
count--;
}
tmParent.children('td').children('span').html(count);
return false;
});
http://jsfiddle.net/LzNVZ/