开发者

A text at bottom right of the window using Javascript

How I can replace a text at the bottom right of the window (not the p开发者_运维百科age) 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.


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.


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)


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜