Guest User

Untitled

a guest
Dec 12th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. function morkovinDisableScrollMenu(mobileMenuWrapp, contentWrapp, disableScroll) {
  2. if (disableScroll === undefined) {
  3. disableScroll = true;
  4. }
  5.  
  6. if ( $('#block-after-menu').length ){
  7. $('#block-after-menu').remove();
  8. }
  9.  
  10. if (disableScroll) {
  11. var offsetBottomMenu;
  12. var winHeight = $(window).height();
  13.  
  14. $(mobileMenuWrapp).after('<div style="text-indent: -9999px; width: 1px; height: 1px;" id="block-after-menu">Конец меню</div>');
  15. offsetBottomMenu = $('#block-after-menu').offset().top;
  16.  
  17. if (winHeight > offsetBottomMenu) {
  18. $(contentWrapp).height(winHeight);
  19. } else {
  20. $(contentWrapp).height(offsetBottomMenu);
  21. }
  22. $(contentWrapp).css('overflow', 'hidden');
  23. } else {
  24. $(contentWrapp).css('overflow', 'hidden');
  25. $(contentWrapp).css("height", "auto");
  26. }
  27. }
Add Comment
Please, Sign In to add comment