Last active
October 19, 2017 14:35
-
-
Save stenrdj/0a8c96d9ca75f96c48d49e0787ac1db6 to your computer and use it in GitHub Desktop.
Responsive code for jquery
This file contains hidden or 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
// On resizing window on desktop | |
$(window).bind('resize',function(){ | |
if($(window).innerWidth() < 450) { | |
// your code here for responsive | |
}else{ | |
//your code here for desktop | |
} | |
}); | |
//end | |
// Checking if its on desktop and make | |
if (window.matchMedia("(max-width: 450px)").matches) { | |
// your code here for responsive | |
}else{ | |
//your code here for desktop | |
} | |
//end check |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment