This is my code that fires whenever the window is resized:
$(window).resize(function()
{
setDisplayBoardSize();
});
Fires fine when I re
var window_width_check_big = false, // flag true if window bigger than my_width
window_width_check_small = false, // flag true if window smaller than my_width
my_width = 1221; // Change to your width
function get_window_size() {
if(window.innerWidth > my_width) {
window_width_check_big = true;
}
if(window.innerWidth < my_width) {
window_width_check_small = true;
}
}
get_window_size();
$(window).resize(function() {
if(window.innerWidth > my_width) {
window_width_check_big = true;
}
if(window.innerWidth < my_width) {
window_width_check_small = true;
}
if( window_width_check_small && window_width_check_big ) {
window_width_check_big = false;
window_width_check_small = false;
get_window_size();
// Start function that you need
}
});