1/******************************************************************************** 2 3 SYNCER ã ç¥èãæåãã¿ããªã¨åæ(Sync)ããããã° 4 5 * é å¸å ´æ 6 https://syncer.jp/jquery-to-top-button 7 8 * æçµæ´æ°æ¥æ 9 2015/08/17 11:23 10 11 * ä½è 12 ããã 13 14 ** é£çµ¡å 15 Twitter: https://twitter.com/arayutw 16 Facebook: https://www.facebook.com/arayutw 17 Google+: https://plus.google.com/114918692417332410369/ 18 E-mail: [email protected] 19 20 â» ãã°ãä¸å ·åã®å ±åãææ¡ããè¦æãªã©ããå¾ ã¡ãã¦ããã¾ãã 21 â» ç³ã訳ããã¾ãããããå©ç¨è æ§ãåã ã®ç°å¢ã«ãããåé¡ã¯ãµãã¼ããã¦ãã¾ããã 22 23********************************************************************************/ 24 25 26// ã°ãã¼ãã«å¤æ° 27var syncerTimeout = null ; 28 29// ä¸é£ã®å¦ç 30$( function() 31{ 32 // ã¹ã¯ãã¼ã«ã¤ãã³ãã®è¨å® 33 $( window ).scroll( function() 34 { 35 // 1ç§ãã¨ã«å¦ç 36 if( syncerTimeout == null ) 37 { 38 // ã»ããã¿ã¤ã ã¢ã¦ããè¨å® 39 syncerTimeout = setTimeout( function(){ 40 41 // 対象ã®ã¨ã¬ã¡ã³ã 42 var element = $( '#page-top' ) ; 43 44 // ç¾å¨ã表示ããã¦ãããï¼ 45 var visible = element.is( ':visible' ) ; 46 47 // æä¸é¨ããç¾å¨ä½ç½®ã¾ã§ã®è·é¢ãåå¾ãã¦ã夿°[now]ã«æ ¼ç´ 48 var now = $( window ).scrollTop() ; 49 50 // æä¸é¨ããç¾å¨ä½ç½®ã¾ã§ã®è·é¢ãè¨ç®ãã¦ã夿°[under]ã«æ ¼ç´ 51 var under = $( 'body' ).height() - ( now + $(window).height() ) ; 52 53 // æä¸é¨ããç¾å¨ä½ç½®ã¾ã§ã®è·é¢(now)ã1500以ä¸ã㤠54 // æä¸é¨ããç¾å¨ä½ç½®ã¾ã§ã®è·é¢(under)ã200px以ä¸ãã¤â¦ 55 if( now > 100 ) 56 { 57 // éè¡¨ç¤ºç¶æ ã ã£ãã 58 if( !visible ) 59 { 60 // [#page-top]ããã£ãããã§ã¼ãã¤ã³ãã 61 element.fadeIn( 'slow' ) ; 62 } 63 } 64 65 // 1500px以ä¸ã㤠66 // è¡¨ç¤ºç¶æ ã ã£ãã 67 else if( visible ) 68 { 69 // [#page-top]ããã£ãããã§ã¼ãã¢ã¦ããã 70 element.fadeOut( 'slow' ) ; 71 } 72 73 // ãã©ã°ãåé¤ 74 syncerTimeout = null ; 75 } , 1000 ) ; 76 } 77 } ) ; 78 79 // ã¯ãªãã¯ã¤ãã³ããè¨å®ãã 80 $( '#move-page-top' ).click( 81 function() 82 { 83 // ã¹ã ã¼ãºã«ã¹ã¯ãã¼ã«ãã 84 $( 'html,body' ).animate( {scrollTop:0} , 'slow' ) ; 85 } 86 ) ; 87} ) ;
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.