Created
March 8, 2012 08:21
-
-
Save jimjeffers/1999629 to your computer and use it in GitHub Desktop.
Allowing media queries to be disabled via CSS class toggle.
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
<!DOCTYPE html> | |
<html class="mediaqueries"> | |
<head> | |
<style type="text/css" media="screen" src="..."></style> | |
</head> | |
<body> | |
... | |
<a href="#" id="mediaToggle">View the full site.</a> | |
</body> | |
</html> |
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
@media only screen and (max-width: 320px) { | |
.mediaqueries { | |
.rule1 { ... } | |
.rule2 { ... } | |
.rule3 { ... } | |
} | |
} |
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 -> | |
$("a#mediaToggle").click (event) -> | |
event.preventDefault() | |
$("html").toggleClass "mediaqueries" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment