showcase/assets/js/theme.js

41 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

2023-07-22 13:34:09 -04:00
(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');