Skip to content

Instantly share code, notes, and snippets.

@andyf-7
Created May 3, 2015 11:00
Show Gist options
  • Save andyf-7/19f0a69dc7791d5f6d1a to your computer and use it in GitHub Desktop.
Save andyf-7/19f0a69dc7791d5f6d1a to your computer and use it in GitHub Desktop.
Client side window onresize for resposivewindow
function resposivewindow(){
// Get the dimensions of the viewport
var width = window.innerWidth ||
document.documentElement.clientWidth ||
document.body.clientWidth;
var height = window.innerHeight ||
document.documentElement.clientHeight ||
document.body.clientHeight;
if(width==1320){ $('.sumitselect').addClass('form-control');}
else if(width==320){ $('.sumitselect').addClass('form-control');}
else if(width==360){ $('.sumitselect').addClass('form-control');}
else if(width==768){ $('.sumitselect').addClass('form-control');}
else if(width==800){ $('.sumitselect').addClass('form-control');}
else if(width==1280){ $('.sumitselect').addClass('form-control');}
else if(width==1920){ $('.sumitselect').addClass('form-control');}
else{ $('.sumitselect').removeClass('form-control');}
};
window.onload = resposivewindow; // When the page first loads
window.onresize = resposivewindow;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment