I have a question: I have a function I want to execute when I call it and to attach an event andler to the function
Now I’m using this solution, but I don’t think it’s best pratice
ff();
$(window).bind('scroll resize', function(){ ff(); });
function ff(){ /* do something */ };
What is the best trick for this problem?
Try this: