Advertisement
Guest User

Untitled

a guest
Jan 25th, 2015
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1.  
  2. _bottomHeader();
  3.  
  4. $(window).on('scroll', function() {
  5. if ($(this).scrollTop() <= obj.sliderHeight) {
  6. _bottomHeader();
  7. } else {
  8. _topHeader();
  9. }
  10. });
  11.  
  12. return obj;
  13.  
  14. function _bottomHeader() {
  15. obj.$header.css({
  16. 'position': 'absolute',
  17. 'top': obj.sliderHeight
  18. });
  19. }
  20.  
  21. function _topHeader() {
  22. obj.$header.css({
  23. 'position': 'fixed',
  24. 'top': 0
  25. });
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement