Last active
August 29, 2015 14:08
-
-
Save macabreb0b/4b9ce9369d3b3d7ab99b to your computer and use it in GitHub Desktop.
Click anywhere on your page to show crosshairs that reveal the vertical + horizontal midpoint.
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
$(function() { | |
$('body').one('click', function(event) { | |
var halfHeight = window.innerHeight / 2; | |
var halfWidth = window.innerWidth / 2; | |
var horizontalRule = $('<div style="width: 100%; height: ' + halfHeight + 'px; border: 0; border-bottom: thin solid blue; position: absolute; top:0;left:0"></div>'); | |
var verticalRule = $('<div style="width: ' + halfWidth + 'px; height: 100%; border: 0; border-right: thin solid blue; position: absolute; top:0;left:0"></div>'); | |
$('body').append(horizontalRule); | |
$('body').append(verticalRule); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment