script.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* $(function() {
  2. $('a[href*=#]:not([href=#])').click(function() {
  3. if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
  4. var target = $(this.hash);
  5. target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
  6. if (target.length) {
  7. $('html,body').animate({
  8. scrollTop: target.offset().top
  9. }, 800);
  10. return false;
  11. }
  12. }
  13. });
  14. });*/
  15. $(function () {
  16. if ($(window).width() >= 992) {
  17. $('#page-education, #page-work, #page-skills, #page-licences, #page-transport, #page-providers, #page-referees').hide();
  18. $('a[href="#page-customers"]').css({ 'color': '#35BD82' });
  19. $('a[href^="#page"]').on('click', function () {
  20. var attrib = $(this).attr('href');
  21. $('a[href^="#page"]').css({ 'color': '#444' });
  22. $(this).css({ 'color': '#35BD82' });
  23. $('[id^="page"]').hide();
  24. $(attrib).show();
  25. });
  26. };
  27. $(window).resize(function () {
  28. var currentWidth = $(window).width();
  29. if (!$('#page-education, #page-about').is(':hidden') && $(window).width() >= 992) {
  30. $('#page-education, #page-work, #page-skills, #page-licences, #page-transport, #page-providers, #page-referees').hide();
  31. $('a[href^="#page"]').css({ 'color': '#444' });
  32. $('a[href="#page-customers"]').css({ 'color': '#35BD82' });
  33. };
  34. if ($(window).width() < 992) {
  35. $('#page-about, #page-education, #page-work, #page-skills, #page-licences, #page-transport, #page-providers, #page-referees').show();
  36. }
  37. });
  38. });