1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title></title> 6 <style> 7 *{margin: 0;padding: 0;list-style: none;border:none} 8 #aside{width: 150px;position: absolute;left: 0;top: 150px;} 9 #aside img{width: 100%;} 10 p{height: 50px;text-align: center;font-size: 20px;} 11 </style> 12 </head> 13 <body> 14 <div id="aside"> 15 <img src = "ImagesRF Royalty Free / float.jpg" alt = ""> 16 </ div> 17 <div> 18 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 19 <the p- > class to take lectures! class to be a good review! Do not play games! </ the p-> 20 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 21 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 22 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 23 <the p-> class to take lectures! class to be a good review! Do play games! </ p> 24- <the p-> class to take lectures! class to be a good review! Do not play games! </ p> 25 <the p-> class to take lectures! class to be a good review! Do not play games! </ p > 26 <the p-> class to take lectures! class to be a good review! Do not play games! </ p> 27 <the p-> class to take lectures! Class to be a good review! Do not play games! </ The p-> 28 <p> class to take lectures! class to be a good review! Do not play games! </ the p-> 29 <p> class to take lectures! class to be a good review! Do not play games! </ the p-> 30 <p> class to take lectures! class to be a good review! Do not play games! </ the p-> 31 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 32 <the p-> class to take lectures! class to be a good review ! Do not play games! </ the p-> 33 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 34 <the p-> class to take lectures! class to be a good review! Do not play games! < / the p-> 35 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 36 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 37 <the p- > class to take lectures! class to be a good review! Do not play games! </ the p-> 38 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 39 < p> class to take lectures! class to be a good review! Do not play games! </ p> 40 <p> class to take lectures! class to be a good review! Do not play games! </ p> 41 <the p-> class to take lectures! Class to be a good review! Do not play games! </ The p-> 42 <the p-> class to take lectures! Class to be a good review! Do not play games! </ The p-> 43 <the p-> class to good lectures! class to be a good review! Do not play games! </ the p-> 44 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 45 <the p-> class to take lectures! class to take review! Do not play games! </ the p-> 46 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 47 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 48 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 49 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 50 < p> class to take lectures! class to be a good review! Do not play games! </ p> 51 <p> class to take lectures! class to be a good review! Do not play games! </ p> 52 <the p-> class to take lectures! Class to be a good review! Do not play games! </ The p-> 53 <p> class to take lectures! class to be a good review! Do not play games! </ the p-> 54 <p> class to take lectures! class to be a good review! Do not play games! </ the p-> 55 <p> class to take lectures! class to be a good review! Do not play games! </ the p-> 56 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 57 <the p-> class to take lectures! class to be a good review ! Do not play games! </ the p-> 58 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 59 <the p-> class to take lectures! class to be a good review! Do not play games! < / the p-> 60 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 61 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 62 <the p- > class to take lectures! class to be a good review! Do not play games! </ the p-> 63 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 64- < p> class to take lectures! class to be a good review! Do not play games! </ p> 65 <p> class to take lectures! class to be a good review! Do not play games! </ p> 66 <the p-> class to take lectures! Class to be a good review! Do not play games! </ The p-> 67 <the p-> class to take lectures! Class to be a good review! Do not play games! </ The p-> 68 <the p-> class to good lectures! class to be a good review! Do not play games! </ the p-> 69 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 70 <the p-> class to take lectures! class to take review! Do not play games! </ the p-> 71 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 72 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 73 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 74 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 75 < p> class to take lectures! class to be a good review! Do not play games! </ p> 76 <p> class to take lectures! class to be a good review! Do not play games! </ p> 77 <the p-> class to take lectures! Class to be a good review! Do not play games! </ The p-> 78 <p> class to take lectures! class to be a good review! Do not play games! </ the p-> 79 <p> class to take lectures! class to be a good review! Do not play games! </ the p-> 80 <p> class to take lectures! class to be a good review! Do not play games! </ the p-> 81 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 82 <the p-> class to take lectures! class to be a good review ! Do not play games! </ the p-> 83 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 84 <the p-> class to take lectures! class to be a good review! Do not play games! < / the p-> 85 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 86 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 87 <the p- > class to take lectures! class to be a good review! Do not play games! </ the p-> 88 <the p-> class to take lectures! class to be a good review! Do not play games! </ the p-> 89 < p> class to take lectures! class to be a good review! Do not play games! </ p> 90 <p> class to take lectures! class to be a good review! Do not play games! </ p> 91 <the p-> class to take lectures! Class to be a good review! Do not play games! </ The p-> 92 <the p-> class to take lectures! Class to be a good review! Do not play games! </ The p-> 93 </ div> 94 95 <Script the src = "JS / myFunc.js"> </ Script> 96 <Script> 97 the window.onload = function () { 98 // 1. Get distance advertising upper level of the head height 99 var offset_top = $ ( 'aside' ) .offsetTop; 100 101 // 2. scroll listening window 102 var the begin = 0, End = 0, Timer = null ; 103 window.onscroll = function () { 104 //2.0 Clear Timer 105 the clearInterval (Timer); 106 107 // 2.1 rolling acquired height scroll own package acquired rolling height 108 var scroll_top = scroll () Top;. 109 End = offset_top + scroll_top; 110 111 // 2.2 easing animation 112 Timer = the setInterval ( function () { 113 the begin the begin = + (End - the begin) * 0.2 ; 114 . $ ( "aside") + style.top the begin = "PX" ; 115 1 16 the console.log (the begin , End); 117 // Clear timer 118 if(Math.round(begin) === end){ 119 clearInterval(timer); 120 } 121 122 }, 20); 123 } 124 } 125 </script> 126 </body> 127 </html>