You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.6 KiB

7 years ago
  1. $(function () {
  2. $('.subnavbar').find ('li').each (function (i) {
  3. var mod = i % 3;
  4. if (mod === 2) {
  5. $(this).addClass ('subnavbar-open-right');
  6. }
  7. });
  8. /* ADDED BY AFAQ */
  9. var pulse_counter; // number of times the element should pulsate
  10. var pulse_interval; // interval (in milliseconds) of pulsating
  11. function pulsate_element(element){
  12. while ( pulse_counter>0){
  13. pulse_counter--;
  14. setTimeout(function(){ element.parent().toggleClass('pulse'); },pulse_interval*pulse_counter);
  15. setTimeout(function(){ element.parent().parent().toggleClass('pulse-boder'); },pulse_interval*pulse_counter);
  16. pulsate_element(element);
  17. }
  18. //if (pulse_counter==0){ pulse_counter=8;}
  19. }
  20. // smooth scrolling for links
  21. $(function() {
  22. $('a[href*=#]:not([href=#])').click(function() {
  23. if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
  24. || location.hostname == this.hostname) {
  25. var target = $(this.hash);
  26. pulse_counter=0; // number of times the element should pulsate
  27. pulse_interval=0; // interval (in milliseconds) of pulsating
  28. pulsate_element(target);
  29. target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
  30. if (target.length) {
  31. $('html,body').animate({
  32. scrollTop: target.parent().offset().top-130
  33. }, 1000);
  34. return false;
  35. }
  36. }
  37. });
  38. });
  39. });