Advertisement
Guest User

Untitled

a guest
Nov 8th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.65 KB | None | 0 0
  1. $(document).ready(function(){
  2.     $('#main-nav li').mouseenter(function(){
  3.         if($(window).height() < 635){
  4.             var currentHeight = $(window).height() - 100;
  5.             var intConvert = currentHeight.toString();
  6.             var heightString = intConvert.concat('px');
  7.  
  8.             $('#main-nav .sub-menu').each(function(){
  9.                 $(this).css('max-height', heightString);
  10.             });
  11.         }
  12.     });
  13.  
  14.     $(window).on('resize', function(){
  15.         if($(window).height() >= 635){
  16.             $('#main-nav .sub-menu').each(function(){
  17.                 $(this).css('max-height', 'none');
  18.             });
  19.         }
  20.     });
  21. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement