1$(document).ready(function () { 2 3 var $header = $('#top-head'); 4 $('#nav-toggle').click(function () { 5 $header.toggleClass('open'); 6 $('body').toggleClass('open'); 7 }); 8 9 $(function () { 10 var dist = 100; 11 $(window).scroll(function () { 12 if ($(window).scrollTop() > dist) { 13 $('#top-head').addClass('thin'); 14 } else { 15 $('#top-head').removeClass('thin'); 16 } 17 }); 18 }); 19 20 var topBtn = $('#pageTop'); 21 topBtn.hide(); 22 $(window).scroll(function () { 23 if ($(this).scrollTop() > 80) { 24 topBtn.fadeIn(); 25 } else { 26 topBtn.fadeOut(); 27 } 28 }); 29 topBtn.click(function () { 30 $('body,html').animate({ 31 scrollTop: 0 32 }, 500); 33 return false; 34 }); 35 36 $('a[href^="#"]').click(function () { 37 var speed = 500; 38 var href = $(this).attr("href"); 39 var target = $(href == "#" || href == "" ? 'html' : href); 40 var position = target.offset().top - 100; 41 $("html, body").animate({ 42 scrollTop: position 43 }, speed, "swing"); 44 return false; 45 }); 46 47 $(window).scroll(function () { 48 $('.fadein').each(function () { 49 var elemPos = $(this).offset().top; 50 var scroll = $(window).scrollTop(); 51 var windowHeight = $(window).height(); 52 if (scroll > elemPos - windowHeight + 50) { 53 $(this).addClass('scrollin'); 54 } 55 }); 56 }); 57 58 59 var itemHeights = []; 60 var returnHeight; 61 62 $(function(){ 63 $(".more-item").each(function(){ 64 var thisHeight = $(this).height(); 65 itemHeights.push(thisHeight); 66 $(this).addClass("is-hide"); 67 returnHeight = $(this).height(); 68 }); 69 }); 70 71 $(".more-trigger").click(function(){ 72 if(!$(this).hasClass("is-show")) { 73 var index = $(this).index(".more-trigger"); 74 var addHeight = itemHeights[index]; 75 $(this).addClass("is-show").next().animate({height: addHeight},200).removeClass("is-hide"); 76 } else { 77 $(this).removeClass("is-show").next().animate({height: returnHeight},200).addClass("is-hide"); 78 } 79 }); 80 81/**/ 82$( '.hideContent' ).hide(); 83 $('.more-btn').on( 'click' ,function(){ 84 85 $panel = $(this).parent(); 86 $panelChild = $panel.children('.hideContent'); 87 88 if( !$panelChild.hasClass('open') ) { 89 $panelChild.slideDown().addClass('open'); 90 $panel.children('.more-btn').addClass('open-label'); 91 } else { 92 $panelChild.slideUp().removeClass('open'); 93 $panel.children('.more-btn').removeClass('open-label'); 94 } 95 return false; 96 97}); 98 99 //current 100 window.addEventListener('load', function() { 101 var naviItem = $('.side-menu ul li'); 102 var boxItem = $('.scroll-point'); 103 var naviNum = naviItem.length; 104 var boxNum = boxItem.length; 105 var naviItemElm = new Array(); 106 var boxItemElm = new Array(); 107 var itemKey = new Array(); 108 var boxKey = new Array(); 109 var distance = new Array(); 110 var height = new Array(); 111 var endPoint = new Array(); 112 113 $(window).on('load scroll', function() { 114 $scrollTopDistance = $(window).scrollTop(); 115 116 for(var a = 0; a < naviNum; a++){ 117 naviItemElm[a] = naviItem.eq(a); 118 boxItemElm[a] = boxItem.eq(a); 119 itemKey[a] = naviItemElm[a].find('a').attr('href').replace(/#/g,""); 120 boxKey[a] = boxItemElm[a].attr('id'); 121 122 distance[a] = boxItemElm[a].offset().top - 120; 123 height[a] = boxItemElm[a].outerHeight(); 124 endPoint[a] = distance[a] + height[a]; 125 126 if(itemKey[a] == boxKey[a] && $scrollTopDistance > distance[a] && $scrollTopDistance < endPoint[a]){ 127 naviItem.eq(a).addClass('current'); 128 }else if($scrollTopDistance < distance[a] || $scrollTopDistance > endPoint[a]){ 129 naviItem.eq(a).removeClass('current'); 130 } 131 } 132 }); 133 }); 134});
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.