views:

48

answers:

3

How I can replace a text at the bottom right of the window (not the page) and that text will follow the corner of the window (in other words, it will stay at the corner of the window). It will be a "share" link, I want it to be seen always.

+1  A: 

If I understand correctly, it's not javascript that you need, just basic css.

You want to position a bar at bottom of the window, that would stay there, even if you scroll down/up?

CSS:

.bottom {
position: fixed;
bottom: 0;
} 

HTML:

<p class="bottom">Text, that you wan't to put at the bottom.</p>

Obviously it's a good idea to add backgroundcolor to the p.bottom, as well as some top-margin or top-padding, but it's just the general idea.

Test it on older IE however, because it may not work.

PawelMysior
Yes. ..........
ilhan
Oh yeah, and add right: 0; to the css.
PawelMysior
+2  A: 

You could use CSS's attribute position: fixed and then use bottom and right values to have it in the bottom right corner. (won't work in IE - needs some hacks)

Piotr Jakubowski
+2  A: 

yeah, as others have mentioned:

#share {
  display: none;
  position: fixed;
  bottom: 0px;
  left: 0px;
  width: 100%;
  z-index: 100;
}

<div id="share">[sharing links]</div>

you could do:

$(document).ready(function() {
  $('#share').fadeIn('slow');
});

this is just like huffingtonpost.com or basicallymoney.com.

jspcal