Created
January 25, 2014 03:04
-
-
Save wangwen1220/8611196 to your computer and use it in GitHub Desktop.
js: 滚动条下拉固定不动 | jquery scroll fixed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 滚动条下拉固定不动 | |
| $(function() { | |
| $(window).scroll(function() { | |
| if ($(window).scrollTop() < 270) { | |
| $('.stayer').removeClass('fixed'); | |
| } | |
| // 不给ie6效果 | |
| if ($(window).scrollTop() > 270 && !($.browser.msie && $.browser.version == '6.0')) { | |
| $('.stayer').addClass('fixed'); | |
| } | |
| }); | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment