1// scroll top 2var lastScrollTop = 0; 3$(window).scroll(function (event) { 4 5 var st = $(this).scrollTop(); 6 var docHeight = $(document).height() - $(window).height(); 7 8 // console.log(st + ' | ' + lastScrollTop + ' | ' + docHeight); 9 10 if (st <= 0 ) { 11 $('.header').removeClass('hide-header'); 12 } 13 else if (st >= 286) { 14 $('.step-5-4 .col-sidebar').addClass('set-fixed'); 15 $('.step-result .col-sidebar').addClass('set-fixed'); 16 17 if (st > lastScrollTop || st >= docHeight) { 18 $('.header').addClass('hide-header'); 19 lastScrollTop = parseInt(st) - 1; 20 } else { 21 $('.header').removeClass('hide-header'); 22 lastScrollTop = parseInt(st) + 1; 23 } 24 } 25 else if (st <= 286) { 26 $('.step-5-4 .col-sidebar').removeClass('set-fixed'); 27 $('.step-result .col-sidebar').removeClass('set-fixed'); 28 29 if (st > lastScrollTop || st >= docHeight) { 30 $('.header').addClass('hide-header'); 31 lastScrollTop = parseInt(st) - 1; 32 } else { 33 $('.header').removeClass('hide-header'); 34 lastScrollTop = parseInt(st) + 1; 35 } 36 } 37 38 else { 39 if (st > lastScrollTop || st >= docHeight) { 40 $('.header').addClass('hide-header'); 41 lastScrollTop = parseInt(st) - 1; 42 } else { 43 $('.header').removeClass('hide-header'); 44 lastScrollTop = parseInt(st) + 1; 45 } 46 } 47}); 48 49// mobile nav 50$('.mobile-nav .menu').on('click', function () { 51 $(this).toggleClass('active'); 52 // return false; 53}); 54 55// parallax content 56function parallax() { 57 $("[data-paroller-factor]").paroller(); 58} 59 60// slide article 61function slideArticle() { 62 $('.box-slide-article .slide-article').slick({ 63 slidesToShow: 3, 64 slidesToScroll: 1, 65 dots: true, 66 responsive: [{ 67 breakpoint: 1280, 68 settings: { 69 slidesToShow: 2, 70 slidesToScroll: 1, 71 infinite: true, 72 dots: true 73 } 74 }, 75 { 76 breakpoint: 480, 77 settings: { 78 slidesToShow: 1, 79 slidesToScroll: 1 80 } 81 } 82 ] 83 }); 84 85} 86 87function accordion() { 88 $('.box-accordion .accordion-title').on('click', function () { 89 $('.box-accordion .accordion').removeClass('active'); 90 $(this).parent().addClass('active'); 91 }); 92} 93 94function slideLink() { 95 $('.slide-link').slick({ 96 slidesToShow: 4, 97 slidesToScroll: 4, 98 arrows: true, 99 infinite: false, 100 prevArrow: $('.box-slide-link .prev'), 101 nextArrow: $('.box-slide-link .next'), 102 responsive: [{ 103 breakpoint: 1024, 104 settings: { 105 slidesToShow: 3, 106 slidesToScroll: 3, 107 infinite: true, 108 dots: true 109 } 110 }, 111 { 112 breakpoint: 600, 113 settings: { 114 slidesToShow: 2, 115 slidesToScroll: 2 116 } 117 }, 118 { 119 breakpoint: 480, 120 settings: { 121 slidesToShow: 1, 122 slidesToScroll: 1 123 } 124 } 125 ] 126 }); 127} 128 129function toolSlide(){ 130 $('.tool-list').on('init reInit afterChange', function (event, slick, currentSlide, nextSlide) { 131 var i = (currentSlide ? currentSlide : 0) + 1; 132 $('.box-tool .slide-pagination').html( '<span class="current-slide">' + i + '</span> / <span class="total-slides"> ' + slick.slideCount + '</span>'); 133 }); 134 135 $('.tool-list').slick({ 136 slidesToShow: 1, 137 slidesToScroll: 1, 138 arrows: true, 139 prevArrow: $('.box-tool .prev'), 140 nextArrow: $('.box-tool .next') 141 }); 142} 143 144function tabResponsive() { 145 $('.tab span.label').on('click', function () { 146 $(this).toggleClass('active'); 147 }); 148 149 $('.tab li a').on('click', function () { 150 var html = $(this).html(); 151 $('.tab span.label').removeClass('active').html(html); 152 }); 153} 154 155function countDownload() { 156 var checkCount; 157 var maxCount = $('input[name="table-select"]').length; 158 $('.checkall').change(function () { 159 if ($(this).prop("checked")) { 160 $('input[name="table-select"]').prop('checked', true); 161 checkCount = $('input[name="table-select"]:checked').length; 162 $('.btn-table-print').find('span').html(checkCount + ' รายà¸à¸²à¸£'); 163 $('#table-overview tr').addClass('selected-data'); 164 $('.btn-table-print').prop('disabled', false); 165 } else { 166 $('input[name="table-select"]').prop('checked', false); 167 checkCount = 0; 168 $('.btn-table-print').find('span').html(''); 169 $('#table-overview tr').removeClass('selected-data'); 170 $('.btn-table-print').prop('disabled', true); 171 } 172 }); 173 174 $('input[name="table-select"]').change(function () { 175 checkCount = $('input[name="table-select"]:checked').length; 176 $('.btn-table-print').prop('disabled', false); 177 $(this).parents('tr').addClass('selected-data'); 178 if (checkCount == 0) { 179 $('.btn-table-print').find('span').html(''); 180 $('.checkall').prop('checked', false); 181 $(this).parents('tr').removeClass('selected-data'); 182 $('.btn-table-print').prop('disabled', true); 183 } else { 184 $('.btn-table-print').find('span').html(checkCount + ' รายà¸à¸²à¸£'); 185 if (checkCount == maxCount) { 186 $('.checkall').prop('checked', true); 187 } else { 188 $('.checkall').prop('checked', false); 189 } 190 } 191 }); 192} 193 194function filter() { 195 $('.box-filter .filter-list li').on('click', function () { 196 $(this).toggleClass('active'); 197 }); 198} 199 200window.print_this = function(id) { 201 var prtContent = document.getElementById(id); 202 var WinPrint = window.open('', '', 'left=0,top=0,width=800,height=900,toolbar=0,scrollbars=0,status=0');
203 WinPrint.document.write('<body class="print-style">'); 204 WinPrint.document.write('<link href="assets/css/layout.css" rel="stylesheet">'); 205 206 WinPrint.document.write(prtContent.innerHTML); 207 WinPrint.document.close(); 208 WinPrint.setTimeout(function(){ 209 WinPrint.focus(); 210 WinPrint.print(); 211 WinPrint.close(); 212 }, 1000); 213} 214 215// home init 216function homeInit(){ 217 slideArticle(); 218 toolSlide(); 219 parallax(); 220 221 $('.home-main-banner .banner').on('init reInit afterChange', function (event, slick, currentSlide, nextSlide) { 222 var mainBanner = (currentSlide ? currentSlide : 0) + 1; 223 $('.home-main-banner .slide-pagination').html( '<span class="current-slide">' + mainBanner + '</span> / <span class="total-slides"> ' + slick.slideCount + '</span>'); 224 }); 225 226 $('.home-main-banner .banner').slick({ 227 slidesToShow: 1, 228 slidesToScroll: 1, 229 arrows: true, 230 autoplay: true, 231 autoplaySpeed: 5000, 232 prevArrow: $('.home-main-banner .prev'), 233 nextArrow: $('.home-main-banner .next') 234 }); 235 236 $('.news-list').on('init reInit afterChange', function (event, slick, currentSlide, nextSlide) { 237 var i = (currentSlide ? currentSlide : 0) + 1; 238 $('.slide-news .slide-pagination').html( '<span class="current-slide">' + i + '</span> / <span class="total-slides"> ' + slick.slideCount + '</span>'); 239 }); 240 241 $('.news-list').slick({ 242 slidesToShow: 2, 243 slidesToScroll: 1, 244 arrows: true, 245 prevArrow: $('.slide-news .prev'), 246 nextArrow: $('.slide-news .next'), 247 responsive: [ 248 { 249 breakpoint: 480, 250 settings: { 251 slidesToShow: 1, 252 slidesToScroll: 1 253 } 254 } 255 ] 256 }); 257} 258 259function popupPDPA(){ 260 $('.popup-pdpa .close-pdpa').on('click', function () { 261 $('.popup-pdpa').hide(); 262 }); 263}
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.