Filippo oretti
Filippo oretti

Reputation: 49817

Twitter-Bootstrap affix

I am trying the affix feature on twitter-bootstrap, what this js method does, cause as i see it just puts the element choosed to:

position:fixed;

Or i'm mistaking and it also controls the element window offsets TOP,BOTTOM,LEFT,RIGHT .. ?

The main method i'm referring to is the :

$('.element').affix();

thanks

Upvotes: 1

Views: 2904

Answers (1)

Arnold Daniels
Arnold Daniels

Reputation: 16553

An example of the use of affix is the menu in the bootstrap documentation.

At the top of the place the menu is just on it's normal position. However if you scroll down, the position of the menu changes so it stays on screen.

You might need to set top for a specific element in CSS.

.bs-docs-sidenav.affix {
  top: 40px;
}

Upvotes: 3

Related Questions