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
I've been looking for a solution to a similar issue. My resize event was triggering when the url input came in and out of view. This is something I've been working on... Could have a possible solution?
So basically you just check if the width of the screen alone has changed or not, and only fire your functions on the resize if it is different:
eg:
var saveWindowWidth = true;
var savedWindowWidth;
//set the initial window width
if (saveWindowWidth = true){
savedWindowWidth = windowWidth;
saveWindowWidth = false;
}
//then on resize...
$(window).resize(function() {
//if the screen has resized then the window width variable will update
windowWidth = window.innerWidth;
//if the saved window width is still equal to the current window width do nothing
if (savedWindowWidth == windowWidth){
return;
}
//if saved window width not equal to the current window width do something
if(savedWindowWidth != windowWidth) {
// do something
savedWindowWidth = windowWidth;
}
});