I have a following function.
var sectionSize = {
onReady: function ($) {
var viewportHeight = $(window).height();
$("#masthead").height(viewportHeight);
}
}
There will be another function inside var sectionSize later. I want the function onReady to be called on document.ready. I learned that to do this, I have to use following code:
jQuery( document ).ready( sectionSize.onReady );
This works perfectly, doing what I need. But I already have a function document.ready there, which already contains another initializing function
jQuery(document).ready(function($) {
(function() {
...
});
})( jQuery );
});
I think to have document.ready twice in the file is nonsence but I am not sure, how to combine these two, so it both initialize the original code and do the sectionSize.onReady function. Anybody help? Thank you!