1 2 3function scrollMotionListener(){ 4 winH = top.window.innerHeight 5 scTop = $(window).scrollTop(); 6 $(".motionUp").each(function(){ 7 if($(this).attr('motion') === 'false'){ 8 if($(this).attr('default-top')<(scTop+winH*0.9)){ 9 $(this).attr('motion',true) 10 let delayNum = Number($(this).attr('data-delay')) || 0 11 let moveTime = Number($(this).attr('data-movetime')) || 0.9 12 TweenMax.to($(this),moveTime,{delay:delayNum*0.1,x:0, y:0, autoAlpha:1, ease:Cubic.easeOut}); 13 } 14 }else{ 15 /* 16 if(!$(this).attr('default-top')) $(this).attr('default-top',($(this).offset().top)) 17 if($(this).attr('default-top')>(scTop+winH*0.85)){ 18 $(this).attr('motion',false) 19 let gapNum = Number($(this).attr('data-movegap')) || 100 20 let moveX = Number($(this).attr('data-moveX')) || 0 21 TweenMax.to($(this),0.5,{x:moveX, y:gapNum, autoAlpha:0, ease:"none"}); 22 } 23 */ 24 } 25 }); 26 // if(scTop>500){ 27 // TweenMax.to($("#btnTop"),0.5,{autoAlpha:1, ease:Expo.easeOut}); 28 // }else{ 29 // TweenMax.to($("#btnTop"),0.5,{autoAlpha:0, ease:Expo.easeOut}); 30 // } 31 TweenMax.to($("#btnTop"), 0.5, { autoAlpha: 1, ease: Expo.easeOut }); 32} 33 34 35function defaultTopReset(){ 36 scTop = $(window).scrollTop(); 37 $(".motionUp").each(function(){ 38 if($(this).attr('default-top') == '0'){ 39 $(this).attr('default-top',($(this).offset().top)); 40 } 41 if($(this).attr('default-top')>(scTop+winH*0.95)){ 42 $(this).attr('motion',false) 43 let gapNum = Number($(this).attr('data-movegap')) || 100 44 let moveX = Number($(this).attr('data-moveX')) || 0 45 TweenMax.to($(this),0.5,{x:moveX, y:gapNum, autoAlpha:0, ease:"none"}); 46 }else{ 47 TweenMax.to($(this),0.5,{x:0, y:0, autoAlpha:1, ease:Sine.easeOut}); 48 } 49 }) 50} 51function pageTopClickHandler(e){ 52 e.preventDefault() 53 TweenMax.to($('body',document),0.5,{scrollTop:0, ease:Cubic.easeOut}); 54} 55 56$(document).ready(function(){ 57 $(".motionUp").each(function(){ 58 $(this).attr('default-top',($(this).offset().top)); 59 let gapNum = Number($(this).attr('data-movegap')) || 100; 60 let initMotion = $(this).attr('data-init') || ''; 61 let moveX = Number($(this).attr('data-moveX')) || 0 62 //console.log(initMotion) 63 $(this).attr('motion',false); 64 if($(this).attr('default-top')>(scTop+winH*0.9) || initMotion != ''){ 65 TweenMax.to($(this),0,{x:moveX, y:gapNum, autoAlpha:0, ease:Expo.easeOut}); 66 } 67 }) 68 $(document,window).bind("scroll",scrollMotionListener); 69 70 scrollMotionListener() 71 72 $("#btnTop").bind('click',pageTopClickHandler); 73}); 74
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.