jquery - Can I put delay(500) before an addClass()? -


$(document).ready(function(){     $("#info-text-container").click(function(){         $("#info-text").delay(500).addclass("info-text-active");     });    }); 

this not put delay on when gets clicked. want accomplish. why , hackable, possible overcome? thanks!

delay works animating methods, can use settimeout function:

$("#info-text-container").click(function(){     settimeout(function(){        $("#info-text").addclass("info-text-active");    }, 500); }); 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -