Hi folks, back again. I just got some help with this snippet...so now I have one final step. This code adds a checkmark to a clicked item 5 seconds after it is clicked. Here's the problem: If three items are clicked in a row quickly, I need to cancel the timeout on the items that are not the last item clicked. The checkbox should only appear if the item is clicked and then five seconds are allowed to elapse. Here's the code:
$(function() {
$('li a').click(function() {
$('li').not('this').css('background-position','left bottom');
$(this).parent().css('background-position','left top');
var thetimeout=window.setTimeout($.proxy(function() {
$(this).parent().css('background-image','url(images/check.png)');
}, this)
,5000);
});
});
Here's the demo:www.jontakiff.com/checks