showcase/assets/js/theme.js
2023-07-22 18:34:09 +01:00

41 lines
No EOL
1.1 KiB
JavaScript

(function ($) {"use strict";
$(function () {
var header = $(".start-style");
$(window).scroll(function () {
var scroll = $(window).scrollTop();
if (scroll >= 10) {
header.removeClass('start-style').addClass("scroll-on");
} else {
header.removeClass("scroll-on").addClass('start-style');
}
});
});
//Animation
$(document).ready(function () {
$('body.hero-anime').removeClass('hero-anime');
});
//Menu On Hover
$('body').on('mouseenter mouseleave', '.nav-item', function (e) {
if ($(window).width() > 750) {
var _d = $(e.target).closest('.nav-item');_d.addClass('show');
setTimeout(function () {
_d[_d.is(':hover') ? 'addClass' : 'removeClass']('show');
}, 1);
}
});
})(jQuery);
// Blank Target External Links
$(document.links).filter(function() {
return this.hostname != window.location.hostname;
}).attr('target', '_blank');