Created
October 21, 2013 04:32
-
-
Save cballenar/7078684 to your computer and use it in GitHub Desktop.
In-browser Photoshop-like guides. After designing in browser for a little while there's been a few times that I wished I had guides in the browser so I decided to see how this worked out. Test page: http://jsbin.com/uHujOyo/3/edit
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
| .guides { | |
| div { | |
| cursor: move; | |
| content: ' '; | |
| display: block; | |
| position: fixed; } | |
| #x { | |
| top: 50%; | |
| width: 100%; height: 1px; | |
| background: cyan; } | |
| #y { | |
| left: 50%; | |
| height: 100%; width: 1px; | |
| background: cyan; } } |
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
| // Guides | |
| // Requires jQuery & jQuery UI (draggable) | |
| $('body').append('<div class="guides"><div id="x"></div><div id="y"></div></div>'); | |
| $('#x').draggable({ axis: 'y' }); | |
| $('#y').draggable({ axis: 'x' }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment