Home › Forums › JavaScript › Function not being updated correctly › Reply To: Function not being updated correctly
December 27, 2015 at 3:26 am
#236172
Shikkediel
Participant
I don’t think ready
can be used in combination with .on
though. But this is an option as well :
$(document).ready(calcLeftWrapper);
Or even :
$(function() {calcLeftWrapper()});
And for the subsequent event listener this is a bit shorter :
$(window).resize(calcLeftWrapper);