<script><!-- [et_pb_line_break_holder] -->function myFunction() {<!-- [et_pb_line_break_holder] --> var $animation_elements = jQuery('.et-waypoint'),<!-- [et_pb_line_break_holder] --> $window = jQuery(window);<!-- [et_pb_line_break_holder] --> function check_if_in_view() {<!-- [et_pb_line_break_holder] --> var window_height = $window.height(),<!-- [et_pb_line_break_holder] --> window_top_position = $window.scrollTop(),<!-- [et_pb_line_break_holder] --> window_bottom_position = (window_top_position + window_height);<!-- [et_pb_line_break_holder] --> <!-- [et_pb_line_break_holder] --> $animation_elements.each(function() {<!-- [et_pb_line_break_holder] --> var $element = jQuery(this),<!-- [et_pb_line_break_holder] --> element_height = $element.outerHeight(),<!-- [et_pb_line_break_holder] --> element_top_position = $element.offset().top,<!-- [et_pb_line_break_holder] --> element_bottom_position = (element_top_position + element_height);<!-- [et_pb_line_break_holder] --> <!-- [et_pb_line_break_holder] --> //check to see if this element is within viewport<!-- [et_pb_line_break_holder] --> if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)) {<!-- [et_pb_line_break_holder] --> $element.addClass('et-animated');<!-- [et_pb_line_break_holder] --> } else {<!-- [et_pb_line_break_holder] --> $element.removeClass('et-animated');<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> });<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> <!-- [et_pb_line_break_holder] --> $window.on('scroll resize', check_if_in_view);<!-- [et_pb_line_break_holder] -->}<!-- [et_pb_line_break_holder] --> window.onload = myFunction;<!-- [et_pb_line_break_holder] --></script><!-- [et_pb_line_break_holder] -->