There\'s a lot of discussion about the soft keyboard but I haven\'t found a good solution for my problem yet.
I have a resize function like:
$(window
There are a few things u need to concentrate about
You can use these combinations when the browser gets resized
function getWidth(){
return $( window ).width();
}
function getHeight(){
return $( window ).height();
}
function isFocus(){
return $(document.activeElement).prop('tagName')=='INPUT' || $(document.activeElement).prop('tagName')=='TEXTAREA';
}
var focused = false;
var windowWidth=getWidth(),windowHeight=getHeight();
//then on resize...
$(window).resize(function() {
var tWidth=getWidth(),tHeight=getHeight(),tfocused=isFocus();
//if the saved window width is still equal to the current window width do nothing
if (windowWidth == tWidth && ((tHeight < windowHeight && !focused && tfocused) || (tHeight > windowHeight && focused && !tfocused))){
windowWidth=tWidth;
windowHeight=tHeight;
focused=tfocused;
return;
}
else{
windowWidth=tWidth;
windowHeight=tHeight;
focused=tfocused;
//Your Code Here
}
});