You can use the jQUery delay () method and create a new queue to perform the action to remove the class.
$("#loadmore").click(function () { cap += 10; loadfeed(); }).addClass("loading").delay(10000).queue(function(){ $(this).removeClass("loading"); $(this).dequeue(); });
If you don't like this, the setTimeout() solution provided by @jcmoney is awesome.
source share