// Fix for required fields in IE < 11: /* if ($("").prop("required") === undefined) { $(document).on("submit", function(e) { $(this) .find("input, select, textarea") .filter("[required]") .filter(function() { return this.value == ''; }) .each(function() { e.preventDefault(); $(this).css({ "border-color":"red" }); alert( $(this).prev('label').html() + " is required!"); }); }); } */ $(function(){ $('#naviga a.option').click(function(){ $('#naviga > input[name=rm]').val(this.id); $('#naviga').submit(); return false; }); // Activate tooltips: $('[data-toggle="tooltip"]').tooltip({container: 'body', delay: {show: 10, hide: 0}}); // Smooth scroll to anchor: $('a[href*="#"]:not([href="#"])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html, body').animate({ scrollTop: target.offset().top - 90 }, 1000); return false; } } }); // Smooth scroll to top: $(window).scroll(function(){ if ($(this).scrollTop() > 100) { $('.scrollup').fadeIn(); } else { $('.scrollup').fadeOut(); } }); $('.scrollup').click(function(){ $('html, body').animate({ scrollTop: 0 }, 600); return false; }); });