Created
April 21, 2015 17:18
-
-
Save thatjeannie/444cc6485bf98963a584 to your computer and use it in GitHub Desktop.
Media Queries in JavaScript (attempt)
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
$(document).ready(function() { | |
// THIS IS SO CONFUSING! | |
if ($(window).width() >= 380) { | |
// NEST! | |
if ($(window).width() >= 680) { | |
// NEST AGAIN! | |
if ($(window).width() >= 768) { | |
// LAST TIME! | |
if ($(window).width() >= 1200) { | |
// stuff for big screens | |
console.log("up to BIG WINDOWS - >= 1200"); | |
} | |
// stuff for tablet->laptop screens | |
console.log("up to LAPTOP WINDOWS - >= 768"); | |
} | |
// stuff for big phones and landscape | |
console.log("up to BIG PHONE WINDOWS - >= 680"); | |
} | |
// stuff for small phones and portrait | |
console.log("up to SMALL PHONE WINDOWS - >= 380"); | |
} | |
}); // end doc ready |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment