Created
July 1, 2013 14:50
-
-
Save scottsappen/5901507 to your computer and use it in GitHub Desktop.
Fixed in place, but moves! Many people think that in order to create something on a page that stays in place (and appears to move) that you actually have to move it. I know that sounds weird, but you wouldn’t believe how many people think you need to use something like jquery. You know, $(“#mydiv”) x and y coordinates, screen top etc…ah, not so,…
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
//and here it is, moving with your mouse | |
<div style="position:fixed;">Move me around</div> | |
It doesn’t need to be much more complicated than that, unless you want to work with non-CSS compliant issues or have concerns about scrolling past other divs etc. But for something simple, this works. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment