Some (well, nearly all) of my code that is in my jQuery .ready function also applies when the window is resized, as it's layout work. However, since it's the same code, how could I "combine" the two functions, so that my code doesn't repeat itself (and be a mess to maintain)?
Thanks!
Another technique is to
.trigger()
one event inside the other:If you put your code at the bottom of the page to avoid needing
$(document).ready
, it gets even simpler:One more better option
Something like this??