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, the power of CSS has been around a good time.

//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.

Advertisements
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: