Is the _.throttle(function() {}, 250)
function only firing on click
? Because I'm trying to run some code with a small delay and it doesn't seem to be working for some reason.
return _.throttle(function() {
return ( $(this).hasClass('dataRevealed') ) ? $(this).addClass('animated fadeOut') : true;
}, 350);
EDIT : The function looks like this :
Application.CardView.prototype.removeSimilarCards = function(_container) {
return $(_container).find('[data-identifier="card-view"]').each(function() {
console.log("first");
_.throttle(function() {
console.log("inner");
return ( $(this).hasClass('dataRevealed') ) ? $(this).addClass('animated fadeOut') : true;
}, 350);
});
};