EstebanDLPT (Talk | contribs) |
EstebanDLPT (Talk | contribs) |
||
Line 11: | Line 11: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
$("#HQ_page").attr('id',''); | $("#HQ_page").attr('id',''); | ||
− | + | /*"use strict"; // Start of use strict*/ | |
+ | |||
+ | //Sidebar menu animations | ||
+ | $('li.sidebar-nav-subitem').addClass('hide'); | ||
+ | $('#menuProject').hover( | ||
+ | function(){ | ||
+ | $('#subProject').stop().slideDown(600); | ||
+ | }, function(){ | ||
+ | $('#subProject').stop().slideUp(800); | ||
+ | } | ||
+ | ); | ||
+ | |||
+ | $('#menuPeople').hover( | ||
+ | function(){ | ||
+ | $('#subPeople').stop().slideDown(600); | ||
+ | }, function(){ | ||
+ | $('#subPeople').stop().slideUp(800); | ||
+ | } | ||
+ | ); | ||
+ | |||
+ | $('#menuParts').hover( | ||
+ | function(){ | ||
+ | $('#subParts').stop().slideDown(600); | ||
+ | }, function(){ | ||
+ | $('#subParts').stop().slideUp(800); | ||
+ | } | ||
+ | ); | ||
+ | |||
+ | $('#menuHP').hover( | ||
+ | function(){ | ||
+ | $('#subHP').stop().slideDown(600); | ||
+ | }, function(){ | ||
+ | $('#subHP').stop().slideUp(800); | ||
+ | } | ||
+ | ); | ||
+ | |||
+ | $('#menuModeling').hover( | ||
+ | function(){ | ||
+ | $('#subModeling').stop().slideDown(600); | ||
+ | }, function(){ | ||
+ | $('#subModeling').stop().slideUp(800); | ||
+ | } | ||
+ | ); | ||
+ | |||
+ | $('#btnKnowTeam').click(function(){ | ||
+ | $('#project').toggleClass('active'); | ||
+ | }); | ||
+ | |||
+ | // Closes the sidebar menu | ||
+ | $(".menu-toggle").click(function(e) { | ||
+ | e.preventDefault(); | ||
+ | $("#sidebar-wrapper").toggleClass("active"); | ||
+ | $('div.brand-hider').toggleClass("active"); | ||
+ | $(".menu-toggle > .fa-bars, .menu-toggle > .fa-times").toggleClass("fa-bars fa-times"); | ||
+ | $(this).toggleClass("active"); | ||
+ | }); | ||
+ | |||
+ | // Smooth scrolling using jQuery easing | ||
+ | $('a.js-scroll-trigger[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 | ||
+ | }, 1000, "easeInOutExpo"); | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | // Closes responsive menu when a scroll trigger link is clicked | ||
+ | $('#sidebar-wrapper .js-scroll-trigger').click(function() { | ||
+ | $("#sidebar-wrapper").removeClass("active"); | ||
+ | $(".menu-toggle").removeClass("active"); | ||
+ | $("div.brand-hider").removeClass("active"); | ||
+ | $(".menu-toggle > .fa-bars, .menu-toggle > .fa-times").toggleClass("fa-bars fa-times"); | ||
+ | }); | ||
+ | |||
+ | // Scroll to top button appear | ||
+ | $(document).scroll(function() { | ||
+ | var scrollDistance = $(this).scrollTop(); | ||
+ | if (scrollDistance > 100) { | ||
+ | $('.scroll-to-top').fadeIn(); | ||
+ | } else { | ||
+ | $('.scroll-to-top').fadeOut(); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | $(window).on("load", function() { | ||
+ | $('body').addClass('loaded'); | ||
+ | }); | ||
+ | }); | ||
</script> | </script> | ||
<style> | <style> |
Revision as of 20:51, 1 June 2018