开发者

Jquery top panel

Hey guys

I have a question which is... I want a panel at the top of my website that stays at the top of the web browsers view. like here

http://webeffectual.com/

In this website the top panel stays at the top even though you scroll through the website

My question is can someone point me in the right direction on ho开发者_如何学Cw to do this or tell me how to do this?


This is what they used on the site you referenced.

Specifically, they are using 'position:fixed; to keep it in place and z-index: 20; to keep it on top.

#header {
  background: url("../images/header.png") repeat-x scroll 0 top transparent;
  position: fixed;
  width: 100%;
  z-index: 20;
  height: 116px;
  top: 0;
  margin: 0;
  padding: 0;
}

That should get you started.


No javascript needed. Just use this css:

#idOfTheBanner { position:fixed;top:0px;} 
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜