简体   繁体   中英

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

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;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM