Skip to content

Instantly share code, notes, and snippets.

@smockle
Created July 7, 2015 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smockle/e9dcf2577e11c3569c2d to your computer and use it in GitHub Desktop.
Save smockle/e9dcf2577e11c3569c2d to your computer and use it in GitHub Desktop.
Don’t let InVision mockups overflow viewport width
/*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