Created
September 5, 2014 13:44
-
-
Save ambienttraffic/6cc5ea80ce5c2475c99a to your computer and use it in GitHub Desktop.
viewport meta tag hack
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
// Check to see if the screen is less than 768 px; add viewport tag if true. | |
// For displaying the full width site on tablets; tablet handles shrinking the layout to fit | |
if(window.outerWidth < 768) { | |
var ele = document.createElement("meta"); | |
ele.name = "viewport"; | |
ele.content = "width=device-width, initial-scale=1.0"; | |
document.head.appendChild(ele); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment