Guest User

Untitled

a guest
Sep 9th, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. compute_top: function compute_top() {
  2.  
  3. // to compute from the bottom of the menu, the top offset is incremented by the menu wrap height
  4.  
  5. td_affix.top_offset = 0;
  6.  
  7.  
  8. if (jQuery(td_affix.menu_wrap_selector).length && jQuery(td_affix.menu_wrap_selector)) {
  9. td_affix.top_offset = jQuery(td_affix.menu_wrap_selector).offset().top + jQuery(td_affix.menu_wrap_selector).height();
  10. }
  11.  
  12.  
  13.  
  14. //check to see if the menu is at the top of the screen
  15. if (td_affix.top_offset == (jQuery(td_affix.menu_wrap_selector).height()) + 1) {
  16. //switch to affix - because the menu is at the top of the page
  17. //td_affix._affix_on(jQuery(td_affix.menu_selector));
  18. td_affix.is_top_menu = true;
  19. } else {
  20. //check to see the current top offset
  21. td_affix.is_top_menu = false;
  22.  
  23. }
  24. td_affix.td_events_scroll(jQuery(window).scrollTop());
  25.  
  26. //alert(td_affix.top_offset);
  27. //console.log('computed: ' + td_affix.top_offset);
  28. },
Advertisement
Add Comment
Please, Sign In to add comment