// The Menu open and Close script --- you thought it would be more complicated didn't you ^_^ $(".burgerMenu").click(function() { $(".menu-expand").slideToggle(200); $(".blacked-out").fadeToggle(200); $(this).toggleClass('activeBurgerMenu'); }); $(".blacked-out").click(function(){ $(".blacked-out").fadeOut(200) $(".menu-expand").slideUp(200); $(".burgerMenu").removeClass('activeBurgerMenu'); }); $(document).keyup(function(e) { if (e.keyCode == 27 && $(".blacked-out").is(':visible')) { $(".menu-expand").slideUp(200); $(".blacked-out").fadeOut(200); $(".burgerMenu").removeClass('activeBurgerMenu'); } // if esc is pressed it also closes the window (now we are better than they are) }); /* clicking on the Find a telkom site opens the input section */ $(document).ready(function () { $(".menu .findTelkom_site label").click(function() { $(".menu .findTelkom_siteInput").show(); $(".menu .findTelkom_siteInput").focus(); if ($(window).width() > 768) { $(".menu-expand").slideUp(200); $(".blacked-out").fadeIn(200); } }); /* this includes the IE fix */ var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { $(".menu .findTelkom_siteInput").blur(function() { $(".menu .findTelkom_siteInput").hide(); }); } else { $(".menu .findTelkom_siteInput").blur(function() { $(".menu .findTelkom_siteInput").hide(); /*$(".menu .findTelkom_siteInput").css("margin-top", -30);*/ }); } }); /* Replaces the Placeholder function for the input with a Value, works on all browsers */ jQuery(function ($) { // Removes the defualt text on key press function keyDown (e) { var input = $(e.target); if (input && !input.data('data-entered')) { input.data('data-entered', true); input.val(""); } } // Restore the default text if empty on blur function blur(e) { var input = $(e.target); if (input && input.val() === "") { input.data('data-entered', false); input.val(input.data('blank-value')); } } $('.sites').each(function () { var input = $(this); input.data('blank-value', input.val()); input.data('data-entered', false); input.keydown(keyDown); input.blur(blur); }); });