timeline.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //[Javascript]
  2. $(function () {
  3. "use strict";
  4. /**********************Scroll Animation "START"************************************/
  5. $(document).ready(function(){
  6. var $animation_elements = $('.anim');
  7. var $window = $(window);
  8. function check_if_in_view() {
  9. var window_height = $window.height();
  10. var window_top_position = $window.scrollTop();
  11. var window_bottom_position = (window_top_position + window_height);
  12. $.each($animation_elements, function() {
  13. var $element = $(this);
  14. var element_height = $element.outerHeight();
  15. var element_top_position = $element.offset().top;
  16. var element_bottom_position = (element_top_position + element_height);
  17. //check to see if this current container is within viewport
  18. if ((element_bottom_position >= window_top_position) &&
  19. (element_top_position <= window_bottom_position)) {
  20. $element.addClass('animated');
  21. } else {
  22. $element.removeClass('animated');
  23. }
  24. });
  25. }
  26. $window.on('scroll resize', check_if_in_view);
  27. $window.trigger('scroll');
  28. });
  29. /**********************Scroll Animation "END"************************************/
  30. /**********************Change color of center aligned animated content small Circle "START"************************************/
  31. $(document).ready(function(){
  32. $(" .debits").hover(function(){
  33. $(" .center-right").css("background-color", "#4997cd");
  34. }, function(){
  35. $(" .center-right").css("background-color", "#fff");
  36. });
  37. });
  38. $(document).ready(function(){
  39. $(".credits").hover(function(){
  40. $(".center-left").css("background-color", "#4997cd");
  41. }, function(){
  42. $(".center-left").css("background-color", "#fff");
  43. });
  44. });
  45. /**********************Change color of center aligned animated content small Circle "END"************************************/
  46. }); // End of use strict