Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jquery.selectBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@
, scrollPos = $(window).scrollTop()
, heightToTop = pos.top - scrollPos
, heightToBottom = $(window).height() - ( heightToTop + controlHeight )
, posTop = heightToTop > heightToBottom
, top = posTop
, posTop = (heightToTop > heightToBottom) && (settings.keepInViewport == null ? true : settings.keepInViewport)
, top = posTop
? pos.top - optionsHeight + borderTopWidth + topPositionCorrelation
: pos.top + controlHeight - borderBottomWidth - bottomPositionCorrelation;

Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ $('select').selectBox({
| topPositionCorrelation | `0` | Integer | Will be plused to top position if droplist will be show at the top |
| bottomPositionCorrelation | `0` | Integer | Will be substracted from top position if droplist will be shown at the bottom |
| hideOnWindowScroll | `true` | Boolean | If false then showed droplist will not hide itself on window scroll event |
| keepInViewport | `true` | Boolean | If set to false, the droplist will be always open towards the bottom |


To specify settings after the init, use this syntax:
Expand Down