1$(function() { 2 var showClass = 'show'; 3 var hideClass = 'hide'; 4 var staticClass = 'static'; 5 var hideCSS = { 6 'z-index': '-1', 7 'visibility': 'hidden', 8 } 9 var pagetopShowTrig = 100; 10 11 var pagetop = $('#pagetop'); 12 var pagetopCloneStatic = pagetop.clone().attr('id', '').addClass(staticClass).css(hideCSS); 13 var pagetopCloneFixed = pagetop.clone().attr('id', '').addClass(showClass).css(hideCSS); 14 pagetop.after(pagetopCloneStatic, pagetopCloneFixed); 15 16 $(window).on('load scroll', function() { 17 var scroll = $(window).scrollTop(); 18 if(scroll >= pagetopShowTrig) { 19 if(!pagetop.hasClass(showClass)) { 20 pagetop.addClass(showClass).removeClass(hideClass); 21 } 22 } else { 23 if(pagetop.hasClass(showClass)) { 24 pagetop.removeClass(showClass).addClass(hideClass); 25 } 26 } 27 if(pagetopCloneStatic.offset().top <= pagetopCloneFixed.offset().top) { 28 if(!pagetop.hasClass(staticClass)) { 29 pagetop.addClass(staticClass); 30 } 31 } else { 32 if(pagetop.hasClass(staticClass)) { 33 pagetop.removeClass(staticClass); 34 } 35 } 36 }); 37 38 var TopBtn = $('#pagetop'); 39 40 //ãã¿ã³ãæ¼ä¸ããã¨ãããã¸ç§»å 41 TopBtn.click(function() { 42 $('body,html').animate({ 43 scrollTop: 0 44 }, 300); 45 return false; 46 }); 47}); 48 49/* 50$(function() { 51 var TopBtn = $('#PageTopBtn'); 52 var BottomPos = 0; // ãã¿ã³ã®ç»é¢ä¸ããã®ä½ç½®ãæå® 53 TopBtn.hide(); 54 $(window).scroll(function(e) { 55 $window = $(e.currentTarget); 56 WindowHeight = $window.height(); // ã¦ã£ã³ãã¦ã®é«ã 57 PageHeight = $(document).height(); // ãã¼ã¸ã®é«ã 58 footerHeight = $(".footer").height(); // ããã¿ã®é«ã 59 ScrollTop = $window.scrollTop(); // ã¹ã¯ãã¼ã«ããé 60 MoveTopBtn = WindowHeight + ScrollTop + footerHeight - PageHeight; 61 62 //ã¹ã¯ãã¼ã«ä½ç½®ã100ã§ãã¿ã³ã表示 63 if ($(this).scrollTop() > 100) { 64 TopBtn.fadeIn(); 65 } 66 else { 67 TopBtn.fadeOut(); 68 } 69 70 // ããã¿ã¼ã¾ã§ã¹ã¯ãã¼ã«ããã¨ãã¿ã³ãç§»å 71 if(ScrollTop >= PageHeight - WindowHeight - footerHeight + BottomPos) { 72 TopBtn.css({ bottom: MoveTopBtn }); 73 } 74 else { 75 TopBtn.css({ bottom: BottomPos }); 76 } 77 }); 78 //ãã¿ã³ãæ¼ä¸ããã¨ãããã¸ç§»å 79 TopBtn.click(function() { 80 $('body,html').animate({ 81 scrollTop: 0 82 }, 300); 83 return false; 84 }); 85}); 86 87 $(function(){ 88 $('a[href^=#]').click(function(){ 89 var speed = 500; 90 var href= $(this).attr("href"); 91 var target = $(href == "#" || href == "" ? 'html' : href); 92 var position = target.offset().top; 93 $("html, body").animate({scrollTop:position}, speed, "swing"); 94 return false; 95 }); 96 }); 97*/ 98 99
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.