Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Commit

Permalink
Probably better overflow logic. Going to have Sean test this.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstraw committed Dec 13, 2013
1 parent ab302b4 commit 9a5556e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fancySelect.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ $.fn.fancySelect = (opts) ->
offParent = parent.offsetParent()

# TODO 20 is very static
if (parent.offset().top + parent.outerHeight() + options.outerHeight() + 20) > $(window).height()
if (parent.offset().top + parent.outerHeight() + options.outerHeight() + 20) > $(window).height() + $(window).scrollTop()
options.addClass 'overflowing'
else
options.removeClass 'overflowing'
Expand Down
2 changes: 1 addition & 1 deletion fancySelect.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ <h1>FancySelect</h1>
<option>Lorem Ipsum</option>
<option>Dolor Sit</option>
<option>Vehicula Ornare</option>
<option>Foo</option>
<option>Bar</option>
<option>Baz</option>
<option>Qux</option>
<option>Zoobie</option>
<option>Frang</option>
</select>

<p>FancySelect is easy to use. Just target any <code>select</code> element on the page, and call <code>.fancySelect()</code> on it. If the select has an option with no value, it'll be used as a sort of placeholder text.</p>
Expand Down

0 comments on commit 9a5556e

Please sign in to comment.