1'use strict'; 2 3// SP reload 4//-------------------------------------------- 5var device, cnt = 0; 6$(window).on('load resize', function(){ 7 var w = window.innerWidth; 8 9 while (cnt==0) { 10 if(w > 767) { 11 device = 0; 12 }else{ 13 device = 1; 14 } 15 cnt++; 16 break; 17 } 18 19 if(w < 768 && device == 0) { 20 window.location = window.location; 21 } 22}); 23 24// history back 25//-------------------------------------------- 26let currentState = history.state; 27window.history.pushState(0,null); 28 29$(function(){ 30 $('#importantNews').each(function(){ 31 $('#container').addClass('importantNews'); 32 }); 33}); 34 35$(function(){ 36// mv 37//-------------------------------------------- 38 $(".mvBg li:not(:first-child)").hide(); 39 setInterval(function() { 40 $(".mvBg li:first-child").fadeOut(1200).next("li").fadeIn(1200).end().appendTo(".mvBg"); 41 },4000); 42}); 43$(window).on('load resize', function(){ 44 mvImgH(); 45}); 46$(function(){ 47 mvImgH(); 48}); 49 50function mvImgH (){ 51 var mvImgH = $('.mvBg img').innerHeight(); 52 var pdTop = 0; 53 var w = $(window).width(); 54 if(w < 750) { 55 pdTop = 57; 56 } 57 $('.mvBg').css('height', mvImgH + pdTop); 58 $('#container > div').css('padding-top', mvImgH + pdTop); 59} 60 61// headline slider 62//-------------------------------------------- 63$(function(){ 64 var mql = window.matchMedia('screen and (max-width: 767px)'); 65 function checkBreakPoint(mql) { 66 if (mql.matches) { 67 // SP 68 $('#headlines .slider').not('.slick-initialized').slick({ 69 autoplay: true, 70 autoplaySpeed: 3000, 71 dots: true, 72 arrows: false, 73 centerMode: true, 74 centerPadding: '50px' 75 }); 76 } else { 77 // PC 78 $('#headlines .slider.slick-initialized').slick('unslick'); 79 } 80 } 81 // ãã¬ã¤ã¯ãã¤ã³ãã®ç¬éã«çºç« 82 mql.addListener(checkBreakPoint); 83 // ååãã§ã㯠84 checkBreakPoint(mql); 85}); 86 87 88$(window).on('load resize', function(){ 89 $('#headlines .inner ul li a .caption1').tile(); 90 $('#headlines .inner ul li a .caption2').tile(); 91}); 92 93 94$(function(){ 95 $('#importantNews').each(function(){ 96 var scroll = $(window).scrollTop(); 97 setTimeout( function () { 98 $("html,body").animate({scrollTop : scroll-1}, {queue : false}); 99 },200); 100 }); 101}); 102 103$(window).on('load resize', function(){ 104 // headline topics img 105 //-------------------------------------------- 106 var headlinesImgH = $('#headlines .figure1').innerWidth(); 107 headlinesImgH = headlinesImgH * 3 / 4; 108 $('#headlines .figure1').css('height', headlinesImgH); 109 110 var headlinesImgH = $('#headlines .figure2').innerWidth(); 111 headlinesImgH = headlinesImgH * 3 / 4; 112 $('#headlines .figure2').css('height', headlinesImgH); 113 114 var topicsimgH = $('#topics figure').innerWidth(); 115 $('#topics figure').css('height', topicsimgH); 116}); 117$(window).load(function () { 118 $('#headlines figure img, #topics figure img').each(function() { 119 var h = $(this).innerHeight(); 120 var w = $(this).innerWidth(); 121 if(h > w) { 122 $(this).addClass('height'); 123 } 124 }); 125}); 126 127$(window).load(function () { 128 129 // randam 130 //-------------------------------------------- 131 var arr = []; 132 $("#special .slider li").each(function() { 133 arr.push($(this).html()); 134 }); 135 arr.sort(function() { 136 return Math.random() - Math.random(); 137 }); 138 $("#special .slider").empty(); 139 for(var i=0; i < arr.length; i++) { 140 $("#special .slider").append('<li>' + arr[i] + '</li>'); 141 } 142 143 144 var $offset = $('#headlines').offset(); 145 $(window).scroll( function () { 146 if($('#menuBtn').hasClass('active')){ 147 }else{ 148 if( $(window).scrollTop() > $offset.top) { 149 //console.log('a'); 150 $('#container>div').addClass('mvhide'); 151 } else { 152 //console.log('b'); 153 $('#container>div').removeClass('mvhide'); 154 } 155 } 156 }); 157 158 // Special Slider 159 //-------------------------------------------- 160 $('#special .slider').slick({ 161 slidesToShow: 3, 162 slidesToScroll: 1, 163 speed: 1000, 164 dots: true, 165 infinite: true, 166 autoplay: true, 167 autoplaySpeed: 2000, 168 draggable: false, 169 centerMode: true, 170 variableWidth: true, 171 useTransform: true, 172 pauseOnFocus: false, 173 pauseOnHover: false, 174 pauseOnDotsHover: false, 175 responsive: [ 176 { 177 breakpoint: 768, 178 settings: { 179 slidesToShow: 1, 180 autoplay: true, 181 autoplaySpeed: 1000, 182 variableWidth: false, 183 dots: true,
184 arrows: false, 185 centerMode: true, 186 centerPadding: '90px', 187 } 188 }] 189 }); 190 191 192 193 var def_width = 0; 194 var initPC = false, 195 initSP = false; 196 197 $(window).resize(function () { 198 var w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; 199 var x = 767; 200 201 if (def_width == w) { 202 return; 203 } else { 204 def_width = w; 205 } 206 207 if (w > x) { 208 //PC 209 if (!initPC) { 210 initPC = true; 211 setEventPCUser(); 212 } 213 } else { 214 //SP 215 if (!initSP) { 216 initSP = true; 217 setEventSPUser(); 218 } 219 } 220 }).trigger('resize'); 221 222 // PC -------------------------------------------------------------------- 223 function setEventPCUser() { 224 225 var newsH = $('#importantNews').innerHeight(); 226 var navH = $('header nav'); 227 navH.css('top', newsH); 228 $(window).scroll(function (){ 229 230 var test = parseInt($('body').css('top')); 231 var scroll = $(window).scrollTop(); 232 if($('header nav').hasClass('fix')){ 233 navH.css('top', 0); 234 }else{ 235 navH.css('top', newsH - scroll); 236 } 237 if(scroll == 0){ 238 navH.css('top', newsH); 239 if($('#menuBtn').hasClass('active')){ 240 navH.css('top', newsH + test); 241 } 242 } 243 }); 244 245 } 246 247 // SP -------------------------------------------------------------------- 248 function setEventSPUser() { 249 250 $('.slider').bind('touchstart', function(){ 251 return true; 252 }); 253 254 $("#importantNews, h1").on('click touchstart',function() { 255 $('#importantNews').each(function(){ 256 if($('#menuBtn').hasClass('active')){ 257 if($('h1').hasClass('fix')){ 258 }else{ 259 setTimeout( function () { 260 $('.navBox').css('position','fixed'); 261 $('.navBox').css('height','100%'); 262 },300); 263 $('.navBox').animate({right: '-100%'}, 300, 'swing'); 264 $('#container').removeClass('fix').css({'top': 0}); 265 $('body').removeClass('fix').css({'top': 0}); 266 window.scrollTo( 0 , scrollfix ); 267 $('#menuBtn').removeClass('active'); 268 } 269 } 270 }); 271 }); 272 273 } 274 275 276 // anim 277 //-------------------------------------------- 278 $('#headlines').addClass('moving'); 279 280 281 // tab 282 //-------------------------------------------- 283 $("#news li").click(function() { 284 var num = $("#news li").index(this); 285 $("#news .box ").hide(); 286 $("#news .box").eq(num).fadeIn(1000); 287 $("#news li").removeClass('active'); 288 $(this).addClass('active'); 289 290 if(num == 1){ 291 window.history.pushState(num,null); 292 }else{ 293 window.history.pushState(num,null); 294 } 295 296 }); 297 298 // history back 299 //-------------------------------------------- 300 if(typeof(currentState) != "undefined"){ 301 $("ul.tab li:eq(" +currentState+ ")" ).trigger("click"); 302 } 303 304 // youtube 305 //-------------------------------------------- 306 $('#movie .thum li').click(function() { 307 var url = $(this).attr('data-url'); 308 var preNum = $('#movie .play iframe').attr('data-num'); 309 if (url) { 310 $('#movie .play iframe').attr('src', url); 311 $(this).css({'display': 'none'}); 312 313 $('#movie .thum li').each(function() { 314 if (preNum == $(this).attr('data-num')) { 315 $(this).css({'display': 'block'}); 316 } 317 }); 318 $('#movie .play iframe').attr('data-num', $(this).attr('data-num')); 319 } 320 }); 321 322 // hover 323 //-------------------------------------------- 324 $('#exam ul li p').on('mouseenter touchstart', function(){ 325 $(this).prev('figure').addClass('active'); 326 }).on('mouseleave touchend', function(){ 327 $(this).prev('figure').removeClass('active'); 328 }); 329 330 $('#exam figure span').on('mouseenter touchstart', function(){ 331 $(this).parent().next('p').addClass('active'); 332 }).on('mouseleave touchend', function(){ 333 $(this).parent().next('p').removeClass('active'); 334 }); 335 336 337 // headline slider 338 //-------------------------------------------- 339/* 340 $(function(){ 341 var mql = window.matchMedia('screen and (max-width: 767px)'); 342 function checkBreakPoint(mql) { 343 if (mql.matches) { 344 // SP 345 $('#calendar .slider.slick-initialized').slick('unslick'); 346 } else { 347 // PC 348 var centerMode = false; 349 if( $('#calendar .slider .item').length < 2) { 350 var centerMode = true; 351 } 352 $('#calendar .slider').not('.slick-initialized').slick({ 353 infinite: false, 354 autoplay: false, 355 slidesToShow: 3, 356 autoplaySpeed: 3000, 357 dots: false, 358 arrows: true, 359 centerMode: centerMode,
360 centerPadding: 0 361 }); 362 } 363 } 364 // ãã¬ã¤ã¯ãã¤ã³ãã®ç¬éã«çºç« 365 mql.addListener(checkBreakPoint); 366 // ååãã§ã㯠367 checkBreakPoint(mql); 368 }); 369 */ 370});
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.