jQuery(function($){ len = $('svg').length; if(len) $('svg title').remove(); $(window).on('scroll', function(){ window_top = window.pageYOffset; window_bottom = $(document).height(); if(window_top > 1000) { $('.arrow_top').show(); } else { $('.arrow_top').hide(); } if( (window_bottom - window_top) < 1000 ) { $('.arrow_down').hide(); } else { $('.arrow_down').show(); } }); $(document).on('click','.arrow_top', function(){ th = $(this); th.addClass('moving'); $('html,body').animate({scrollTop: 0}, 500); $('.arrow_top').hide(); setTimeout(function(){ $('.arrow_top').removeClass('moving'); }, 1000); }); $(document).on('click','.arrow_down', function(){ th = $(this); th.addClass('moving'); $("html, body").animate({ scrollTop: $(document).height() }, 500); //$('.arrow_top').hide(); setTimeout(function(){ $('.arrow_down').removeClass('moving'); }, 1000); }); $(document).on('click', '#terms_link', function(){ window.open('/terms', '_blank'); }); $(document).on('click', '.t_button', function(e){ th = $(this); target = e.target.nodeName; find_a = th.find('a').length; if(target == 'DIV' && find_a) { th.find('a').get(0).click(); } }); });