javascript - How to create universal timeout function with jquery -
so, need have universal timeout function script. need use many times , want universalize it, try that, smthg wrong, can u me?
$.fn.timeout = function(action, time){ settimeout(function(){ action; }, time); return this; }
and call:
.timeout( settings_container.addclass('slide_down'), 200 );
thx.
you aren't executing action function,
change:
action;
to:
action();
Comments
Post a Comment