I need to trigger a function AFTER my div #gMap has resized itself to my variable mapHeight. Using a phone I find the following is triggered too early.
$(window).resize(function () {
   var mapHeight = (viewport() - 85);
   $("#gMap").height(mapHeight);
   myNewFunction();
});
function viewport() {
    var w = window, d = document, e = d.documentElement, g = d.getElementsByTagName('body')[0], x = w.innerWidth || e.clientWidth || g.clientWidth, y = w.innerHeight || e.clientHeight || g.clientHeight;
    return y;
}
function myNewFunction(){
   alert("Div is resized");
}
 
    