Template:Technion/Javascript

$(document).ready(function() {

var hover_flag = $(".dropdown").is(":hover"); var scroll_flag;

if (window.scrollY >= 450) { scroll_flag = 1; } else { scroll_flag = 0; }

if ((hover_flag == false) && (scroll_flag == 1)) { $(".dropdown nav").css("max-height", "0px"); } else { $(".dropdown nav").css("max-height", "999px"); }


window.onscroll=function() { if (window.scrollY >= 450) { scroll_flag = 1; } else { scroll_flag = 0; } if ((hover_flag == false) && (scroll_flag == 1)) { $(".dropdown nav").css("max-height", "0px"); } else { $(".dropdown nav").css("max-height", "999px"); } } });