Created
July 7, 2015 18:21
-
-
Save smockle/e9dcf2577e11c3569c2d to your computer and use it in GitHub Desktop.
Don’t let InVision mockups overflow viewport width
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
/*eslint-env browser */ | |
/*eslint quotes: [1, "single"] */ | |
(function() { | |
'use strict'; | |
var selectors = [ '.viewport', 'div.screen', 'div.screen img' ]; | |
selectors.forEach(function(selector) { | |
var element = document.querySelector(selector); | |
if (!(element instanceof HTMLElement)) { return; } | |
element.style.height = 'auto'; | |
element.style.width = '100vw'; | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment