Skip to content

Instantly share code, notes, and snippets.

@yramagicman
Last active December 15, 2015 16:19
Show Gist options
  • Save yramagicman/5287849 to your computer and use it in GitHub Desktop.
Save yramagicman/5287849 to your computer and use it in GitHub Desktop.
Create guides on a webpage
(function () {
'use strict';
var vGuidePos = '50%';
var hGuidePos = '50%';
var vguide = document.createElement('div');
var hguide = document.createElement('div');
var vstyle = vguide.style;
var hstyle = hguide.style;
vstyle.borderLeft = ' 1px solid red';
vstyle.width = '1px';
vstyle.height = '100%';
vstyle.position = 'fixed';
vstyle.top = '0';
vstyle.zIndex = '99999999';
vstyle.left = vGuidePos;
hstyle.borderTop = ' 1px solid red';
hstyle.width = '100%';
hstyle.height = '1px';
hstyle.position = 'fixed';
hstyle.top = hGuidePos;
hstyle.left = '0';
hstyle.zIndex = '99999999';
document.body.appendChild(vguide);
document.body.appendChild(hguide);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment