0

I'm making a simple (test)-website and I want to add a menubar (at the top of the website) that stays on the same place when you scroll down instead of it's disappears. I know I need jQuery and probably also JavaScript. Its not like a sliding menu, it's like stackoverflow has on the right side of the website when you want to post a question -> but now I want it on de top with an menubar.

How can I make this sort of menu bar?

thanks for responds,

Niels.

Ni3l55
  • 43
  • 1
  • 6

2 Answers2

3

You only need CSS. You merely have to give it a fixed position:

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

That will scroll with the page. See also this SO Question.

Community
  • 1
  • 1
John Woodruff
  • 1,608
  • 16
  • 29
0

Is this effect that you want? http://www.sutanaryan.com/Tutorials/fixed-menu-when-scrolling-page-with-CSS-and-jQuery/

Yoann Augen
  • 1,966
  • 3
  • 21
  • 39