scripts.js 982 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* activate scrollspy menu */
  2. $('body').scrollspy({
  3. target: '#navbar-collapsible',
  4. offset: 52
  5. });
  6. /* smooth scrolling sections */
  7. $('a[href*=#]:not([href=#])').click(function() {
  8. if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
  9. var target = $(this.hash);
  10. target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
  11. if (target.length) {
  12. $('html,body').animate({
  13. scrollTop: target.offset().top - 50
  14. }, 800);
  15. if (this.hash=="#section1") {
  16. $('.scroll-up').hide();
  17. }
  18. else {
  19. $('.scroll-up').show();
  20. }
  21. // activte animations in this section
  22. target.find('.animate').delay(1200).addClass("animated");
  23. setTimeout(function(){
  24. target.find('.animated').removeClass("animated");
  25. },2000);
  26. return false;
  27. }
  28. }
  29. });