Open DanielJohnsson87 opened 8 years ago
Hey thanks for contributing! What's the usecase for this? That callback could get called thousands of times onresize
.
Sorry for the bad explanation.
The usecase for me was to add a class to the elements effected after page load once the elements font-size is set. To prevent flash of unstyled content I've hidden all titles and in the callback I will add a animate-in/show css class to display the titles after the correct font-size is set.
I'm aware that the callback would run on every 'onresize'-event and I'm handling that on my side. But it didn't make much sense to add a callback to the plugin if it only fires sometimes.
Perhaps adding a variable to the callback to control if the callback should run once or every time could be a solution? The default being that the callback only runs one time?
Ah. I think I sorta understand. Might be kinda niche to your implementation. The need for a callback hasn't come up much in the last 5yrs. Do you have a CodePen or something showing what you're doing? I want to be sure I understand it completely.
I'v added a callback to the settings object. It will run once the $.each functions is done.