Created
May 3, 2015 11:00
-
-
Save andyf-7/19f0a69dc7791d5f6d1a to your computer and use it in GitHub Desktop.
Client side window onresize for resposivewindow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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