Skip to content

Instantly share code, notes, and snippets.

@jimjeffers
Created March 8, 2012 08:21
Show Gist options
  • Save jimjeffers/1999629 to your computer and use it in GitHub Desktop.
Save jimjeffers/1999629 to your computer and use it in GitHub Desktop.
Allowing media queries to be disabled via CSS class toggle.
<!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>
@media only screen and (max-width: 320px) {
.mediaqueries {
.rule1 { ... }
.rule2 { ... }
.rule3 { ... }
}
}
$(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