1// JavaScript Document 2 3 4// external js: isotope.pkgd.js 5 6// init Isotope 7function isopmain() { 8 9 var $grid = $('.grid').isotope({ 10 itemSelector: '.element-item', 11 layoutMode: 'fitRows' 12 }); 13// filter functions 14 var filterFns = { 15 // show if number is greater than 50 16 numberGreaterThan50: function () { 17 var number = $(this).find('.number').text(); 18 return parseInt(number, 10) > 50; 19 }, 20 // show if name ends with -ium 21 ium: function () { 22 var name = $(this).find('.name').text(); 23 return name.match(/ium$/); 24 } 25 }; 26// bind filter button click 27 $('.filters-button-group').on('click', 'button', function (e) { 28 e.preventDefault(); 29 var filterValue = $(this).attr('data-filter'); 30 // use filterFn if matches value 31 filterValue = filterFns[filterValue] || filterValue; 32 $grid.isotope({filter: filterValue}); 33 }); 34// change is-checked class on buttons 35 $('.button-group').each(function (i, buttonGroup) { 36 var $buttonGroup = $(buttonGroup); 37 $buttonGroup.on('click', 'button', function () { 38 $buttonGroup.find('.is-checked').removeClass('is-checked'); 39 $(this).addClass('is-checked'); 40 }); 41 }); 42 43 44} 45 46setTimeout(function () { 47 isopmain(); 48}, 500); 49 50 51$(function () { 52 53 $('body').addClass("myclass") 54 $breakPoint = 768; 55 function bodySwitch() { 56 var $body = $('body'); 57 var windowWidth = parseInt($(window).width()); 58 if (windowWidth > $breakPoint) { 59 $body.removeClass("sp").addClass("pc"); 60 } else if (windowWidth < $breakPoint) { 61 $body.removeClass("pc").addClass("sp"); 62 } 63 } 64 65 bodySwitch(); 66 67 68 /*$(window).one('load' ,function(){ 69 var browserLanguage = function() { 70 var ua = window.navigator.userAgent.toLowerCase(); 71 try { 72 // chrome 73 if( ua.indexOf( 'chrome' ) != -1 ){ 74 return ( navigator.languages[0] || navigator.browserLanguage || navigator.language || navigator.userLanguage).substr(0,2); 75 } 76 // ããä»¥å¤ 77 else{ 78 return ( navigator.browserLanguage || navigator.language || navigator.userLanguage).substr(0,2); 79 } 80 } 81 catch( e ) { 82 return undefined; 83 } 84 }; 85 // æ¥æ¬èª 86 if( browserLanguage() == 'ja' ){ 87 location.replace = '/ja/'; 88 } 89 // ãã®ä» 90 else{ 91 location.replace = '/'; 92 } 93 return false; 94 }); 95 */ 96 $("#globalmenu li a").hover(function () { 97 $(this).toggleClass("hover"); 98 }); 99 100 $(".hover").pxgradient({ 101 step: 10, 102 colors: ["#24b497", "#004593"], 103 dir: "x" 104 }); 105 106 function movie() { 107 var w = $(window).width(); 108 var h = w / 1280 * 549; 109 $('section#top01').css('height', h); 110 } 111 112 movie(); 113 114 115 function insta() { 116 var iw = $('#instafeed li').width(); 117 // console.log(iw); 118 var ih = iw; 119 $('#instafeed li').css('height', ih); 120 121 } 122 123 insta(); 124 125 $(window).resize(function () { 126 movie(); 127 insta(); 128 bodySwitch(); 129 if ($(window).width() > $breakPoint) { 130 $(".menu-trigger").removeClass('active1'); 131 $('.sp-nav').css('display', 'none'); 132 // $("main,body").css({'overflow':'auto','height':'auto','position':'relative'}); 133 // $("main").css({'transform':'scale(1,1)'}); 134 } 135 }); 136 137 138 $(window).bind("load", function () { 139 if (document.URL.match(/ja/)) { 140 $('.sns-list li:nth-child(10) a').css('color', '#00b78e'); 141 } else { 142 $('.sns-list li:nth-child(8) a').css('color', '#00b78e'); 143 } 144 145 bodySwitch(); 146 }); 147 148 149 $(document).ready(function () { 150 151 $(".close").click(function () { 152 $(".modal").removeClass("in"); 153 }); 154 $('.menu-trigger').on('click', function () { 155 $(this).toggleClass('active1'); 156 157 158 if ($(".menu-trigger").hasClass("active1")) { 159 $(".sp-nav").delay(30).fadeIn(); 160 $('.gnav-sp li').each(function (i) { 161 $(this).delay(50 * i).animate({'opacity': 1, 'margin-left': '0px'}); 162 }); 163 $(".sp-sns").delay(450).animate({'opacity': 1, 'right': '0'}); 164 $(".ln-change").delay(500).animate({'opacity': 1, 'right': '0'}); 165 166 // $("main,body").css({'overflow':'hidden','height':'100%','position':'fixed'}); 167 // $("main").css({'transform':'scale(0.95,0.95)'}); 168 169 170 } else { 171 $('.gnav-sp li').each(function (i) { 172 $(this).delay(25 * i).animate({'opacity': 0, 'margin-left': '-10px'}); 173 }); 174 $(".sp-sns").delay(225).animate({'opacity': 0, 'right': '10px'}); 175 $(".ln-change").delay(250).animate({'opacity': 0, 'right': '10px'}); 176 $(".sp-nav").delay(300).fadeOut(); 177 // $("main,body").css({'overflow':'auto','height':'auto','position':'relative'}); 178 // $("main").css({'transform':'scale(1,1)'}); 179 } 180 }); 181 182 183 });
184 185 $(function () { 186 // #ã§å§ã¾ãã¢ã³ã«ã¼ãã¯ãªãã¯ããå ´åã«å¦ç 187 $('a[href^=#]').click(function () { 188 // ã¹ã¯ãã¼ã«ã®é度 189 var speed = 400; // ããªç§ 190 // ã¢ã³ã«ã¼ã®å¤åå¾ 191 var href = $(this).attr("href"); 192 // ç§»åå ãåå¾ 193 var target = $(href == "#" || href == "" ? 'html' : href); 194 // ç§»åå ãæ°å¤ã§åå¾ 195 var position = 0; 196 197 if (target.offset() != undefined) { 198 position = target.offset().top; 199 } 200 else { 201 position = $("body").offset().top; 202 } 203 204 205 // ã¹ã ã¼ã¹ã¹ã¯ãã¼ã« 206 $('body,html').animate({scrollTop: position}, 600, 'easeInOutExpo'); 207 return false; 208 }); 209 }); 210 211 $(function () { 212 // ã¹ã¯ãã¼ã«éä¸ãã表示ãããã¡ãã¥ã¼ãã¼ãæå® 213 var navBox = $(".to-top"); 214 var y = $(window).height() - 500; 215 216 // ã¡ãã¥ã¼ãã¼ã¯åæç¶æ ã§ã¯æ¶ãã¦ãã 217 navBox.hide(); 218 219 // 表示ãéå§ããã¹ã¯ãã¼ã«éãè¨å®(px) 220 var TargetPos = y; 221 222 // ã¹ã¯ãã¼ã«ãããéã«å®è¡ 223 $(window).scroll(function () { 224 // ç¾å¨ã®ã¹ã¯ãã¼ã«ä½ç½®ãåå¾ 225 var ScrollPos = $(window).scrollTop(); 226 // ç¾å¨ã®ã¹ã¯ãã¼ã«ä½ç½®ã¨ãç®çã®ã¹ã¯ãã¼ã«ä½ç½®ãæ¯è¼ 227 if (ScrollPos > TargetPos) { 228 // 表示(ãã§ã¤ãã¤ã³) 229 navBox.fadeIn('fast'); 230 } 231 else { 232 // é表示(ãã§ã¤ãã¢ã¦ã) 233 navBox.fadeOut('fast'); 234 235 } 236 237 }); 238 }); 239 240 241 $(".play-btn").click(function () { 242 $(".sp-movie").fadeIn(); 243 244 }); 245 246 $(".movie-close,.sp-movie").click(function () { 247 $(".sp-movie").fadeOut(); 248 }); 249 250 $(function () { 251 var $setElm = $('.feature-cap ,.news-cap span'); 252 var cutFigure = '75'; // ã«ããããæåæ° 253 var afterTxt = ' â¦'; // æåã«ããå¾ã«è¡¨ç¤ºããããã¹ã 254 255 $setElm.each(function () { 256 var textLength = $(this).text().length; 257 var textTrim = $(this).text().substr(0, (cutFigure)) 258 259 if (cutFigure < textLength) { 260 $(this).html(textTrim + afterTxt).css({visibility: 'visible'}); 261 } else if (cutFigure >= textLength) { 262 $(this).css({visibility: 'visible'}); 263 } 264 }); 265 }); 266 267 268}); 269 270 271$(document).ready(function () { 272 273 274 $('#gallery-1').royalSlider({ 275 fullscreen: { 276 enabled: true, 277 nativeFS: true 278 }, 279 controlNavigation: 'thumbnails', 280 autoScaleSlider: true, 281 autoScaleSliderWidth: 0, 282 startSlideId: 0, 283 autoScaleSliderHeight: 0, 284 loop: false, 285 addActiveClass: true, 286 autoHeight: true, 287 imageScaleMode: false, 288 navigateByClick: true, 289 numImagesToPreload: 6, 290 arrowsNav: true, 291 arrowsNavAutoHide: false, 292 arrowsNavHideOnTouch: true, 293 keyboardNavEnabled: true, 294 fadeinLoadedSlide: true, 295 globalCaption: true, 296 globalCaptionInside: false, 297 thumbs: { 298 appendSpan: true, 299 firstMargin: 0, 300 paddingBottom: 0, 301 spacing: 27 302 } 303 }); 304 305 /*$('.product-slider').bxSlider({ 306 pager:false, 307 nextSelector: '#product-next-btn', 308 prevSelector: '#product-prev-btn', 309 nextText: '', 310 prevText: '' 311 });*/ 312 313 $(".content-scroll").mCustomScrollbar(); 314 315 316 if ($(window).width() < 1200) { 317 $('.product-slider').bxSlider({ 318 pager: false, 319 nextSelector: '#product-next-btn', 320 prevSelector: '#product-prev-btn', 321 nextText: '', 322 prevText: '' 323 }); 324 } 325 if ($(window).width() > 1200) { 326 327 $(".product-scroll").mCustomScrollbar({ 328 axis: "x", 329 autoDraggerLength: false, 330 advanced: { 331 autoExpandHorizontalScroll: true 332 } 333 }); 334 335 } 336 337 338 $('#product-tabs a').click(function (e) { 339 e.preventDefault() 340 $(this).tab('show'); 341 //$(this).tab().find(".filters-button-group button:last-child").addClass("needclick"); 342 setTimeout(function () { 343 isopmain(); 344 }, 300); 345 });
346 347 348 if ($(window).width() < 1024) { 349 $(".item-inr-text").click(function () { 350 $(".item-inr-hover").css({"visibility": "hidden", "opacity": "0"}); 351 $(this).find(".item-inr-hover").css({"visibility": "visible", "opacity": "1"}); 352 }); 353 $(".item-inr-text").mouseout(function () { 354 $(".item-inr-hover").css({"visibility": "hidden", "opacity": "0"}); 355 }); 356 } 357 358 359 if ($(window).width() < 1030) { 360 $(".languagechanger").click(function () { 361 $(this).toggleClass("lang-open"); 362 }); 363 } 364 365 366 $("ul.gnav-sp li").has("ul").addClass("lihasul"); 367 $(".lihasul a").click(function () { 368 $(this).toggleClass("mobile_m_open"); 369 $(this).next("ul").slideToggle(); 370 }); 371 372 373 /*var pathname = window.location.pathname; 374 var appId = pathname.split('/')[1];*/ 375 376 var pathname = window.location.pathname; 377 var appId = pathname.split('/')[2]; 378 $('ul#globalmenu li').find('a[href="' + window.location.pathname + '"]').addClass('on'); 379 $('ul#globalmenu > li').find('a[href="' + window.location.href + '"]').addClass('on'); 380 $("ul#globalmenu ul li a.on").parents("li").eq(1).addClass("active-m"); 381 $('ul#globalmenu ul li').find('a[href="' + window.location.pathname + '"]').parents("li").children("a").addClass('on'); 382 383 var appId2 = pathname.split('/'); 384 var urlcount = appId2.length; 385 386 if (urlcount > 3) { 387 var appId3 = appId2[3].split('-'); 388 if (appId3[0] == "light" || appId3[2] == "bus") { 389 $('ul#globalmenu li').find('a[href*="' + appId + '"]').parents("li").eq(2).addClass('active-m'); 390 $('ul.gnav-sp > li').find('a[href*="' + appId + '"]').parents("li").eq(2).addClass('active-m'); 391 if (appId3[0] == "light" && appId3[1] == "truck") { 392 $('ul#globalmenu li').find('a[href*="' + appId + '"]').parents("li").eq(1).addClass('active-m'); 393 } 394 else { 395 $('ul#globalmenu li').find('a[href*="' + appId + '"]').parents("li").eq(0).addClass('active-m'); 396 } 397 } 398 else if (appId3[0] == "car" || appId3[0] == "suv") { 399 $('ul#globalmenu li').find('a[href*="' + appId + '"]').parents("li").eq(5).addClass('active-m'); 400 $('ul.gnav-sp > li').find('a[href*="' + appId + '"]').parents("li").eq(5).addClass('active-m'); 401 if (appId3[0] == "car" && appId3[1] == "tyres") { 402 $('ul#globalmenu li').find('a[href*="' + appId + '"]').parents("li").eq(4).addClass('active-m'); 403 } 404 if (appId3[0] == "suv") { 405 $('ul#globalmenu li').find('a[href*="' + appId + '"]').parents("li").eq(3).addClass('active-m'); 406 } 407 } 408 else { 409 $('ul#globalmenu li').find('a[href*="' + appId + '"]').parents("li").eq(0).addClass('active-m'); 410 } 411 } 412 413 $('.toplocator').find('a[href="' + window.location.pathname + '"]').addClass('on'); 414 415 $(".menu-list li").find('a[href="' + window.location.pathname + '"]').addClass('on'); 416 $('.menu-list > li').find('a[href*="' + appId + '"]').addClass('on'); 417 418 /*----------FOR MOBILE ACTIVE CLASS----------*/ 419 420 $('ul.gnav-sp li').find('a[href="' + window.location.href + '"]').addClass('on'); 421 //if (appId != "") { 422 // $('ul.gnav-sp li').find('a[href$="' + appId + '"]').addClass('on'); 423 //} 424 //$('ul.gnav-sp > li').find('a[href*="' + appId + '"]').addClass('on'); 425 $("ul.gnav-sp ul li a.on").parents("li").eq(1).addClass("active-m"); 426 $('ul.gnav-sp ul li').find('a[href="' + window.location.pathname + '"]').parents("li").children("a").addClass('on'); 427 428 429 $("#product-tabs li a").click(function () { 430 431 var attvalu = $(this).attr("href"); 432 $("#product-tabs li").removeClass("active"); 433 $(this).parents("li").addClass("active"); 434 $(".tab-content").find(attvalu).find(".filters-button-group [data-filter*='.allview']").trigger('click'); 435 }); 436 437 438 439 /*----------FOR MOBILE ACTIVE CLASS----------*/ 440 441 console.log(appId); 442 console.log(" URL " + window.location.href); 443 444 445 446 447 448 /*$("#long-distance .filters-button-group button:last-child").trigger('click');*/ 449 450 /*$("#long-distance .filters-button-group button:last-child").addClass("hello");*/ 451 452 453 if ($(window).width() < 767) { 454 455 $(".sp-top .play-btn").click(function () { 456 $("body#Body").addClass("video_p_open"); 457 }); 458 459 $(".movie-close").click(function () { 460 $("body#Body").removeClass("video_p_open"); 461 }); 462 463 } 464 465 // cookie region start 466 $('body').on('click', '.cookie-bar .btn-red', function () {
467 setCookie("AcceptCookieBar", "true", 30); 468 $('.cookie-bar').hide(); 469 $('.cookie-popup-overlay').removeClass('active'); 470 471 }); 472 473 var acceptCookieBar = getCookie("AcceptCookieBar"); 474 if (acceptCookieBar) { 475 $('.cookie-bar').hide(); 476 } 477 else { 478 $('.cookie-popup-overlay').addClass('active'); 479 } 480 481 if ($(".cookie-popup-overlay").hasClass("active")) { 482$("body").addClass("intro"); 483} 484 // cookie region end 485 486}); 487 488//#region accept cookie 489 490function setCookie(cname, cvalue, exdays) { 491 var d = new Date(); 492 d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); 493 var expires = "expires=" + d.toUTCString(); 494 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 495} 496 497function getCookie(cname) { 498 var name = cname + "="; 499 var decodedCookie = decodeURIComponent(document.cookie); 500 var ca = decodedCookie.split(';'); 501 for (var i = 0; i < ca.length; i++) { 502 var c = ca[i]; 503 while (c.charAt(0) == ' ') { 504 c = c.substring(1); 505 } 506 if (c.indexOf(name) == 0) { 507 return c.substring(name.length, c.length); 508 } 509 } 510 return ""; 511} 512 513//#endregion 514 515 516//$(function(){ 517// var changeLanguage = function(lang){ 518// document.cookie = 'falkenlang='+encodeURIComponent(lang)+';path=/;'; 519// } 520 521// var documentLanguage = function(){ 522// if(window.location.pathname.match(/^\/ja\//)){ 523// return 'ja'; 524// }else{ 525// return 'en'; 526// } 527// } 528 529// var browserLanguage = function(){ 530// var ua = window.navigator.userAgent.toLowerCase(); 531// try{ 532// // chrome 533// if(ua.indexOf('chrome') != -1){ 534// return (navigator.languages[0] || navigator.browserLanguage || navigator.language || navigator.userLanguage).substr(0, 2); 535// }else{ 536// return (navigator.browserLanguage || navigator.language || navigator.userLanguage).substr(0, 2); 537// } 538// } 539// catch(e) { 540// return undefined; 541// } 542// } 543// var redirectLanguage = function(lang){ 544// var basePath; 545// if(window.location.pathname.match(/^\/ja(\/.*)/)){ 546// basePath = RegExp.$1; 547// }else{ 548// basePath = window.location.pathname; 549// } 550// if(lang == 'en'){ 551// location.href = basePath; 552// }else{ 553// location.href = '/'+lang+basePath; 554// } 555// } 556// var getCookie = function(name){ 557// var result = null; 558// var cookieName = name + '='; 559// var allcookies = document.cookie; 560 561// var position = allcookies.indexOf(cookieName); 562// if(position != -1){ 563// var startIndex = position + cookieName.length; 564// var endIndex = allcookies.indexOf(';', startIndex); 565// if( endIndex == -1 ){ 566// endIndex = allcookies.length; 567// } 568// result = decodeURIComponent(allcookies.substring(startIndex, endIndex)); 569// } 570// return result; 571// } 572 573// var fcookie = getCookie('falkenlang'); 574// if(fcookie != 'en' && fcookie != 'ja'){ 575// if(browserLanguage() == 'ja'){ 576// fcookie = 'ja'; 577// }else{ 578// fcookie = 'en'; 579// } 580// changeLanguage(fcookie); 581// } 582// if(documentLanguage() != fcookie){ 583// redirectLanguage(fcookie); 584// }else{ 585// $("a[data-txt='JP']").on('click', function(){ 586// changeLanguage('ja'); 587// }); 588// $("a[data-txt='EN']").on('click', function(){ 589// changeLanguage('en'); 590// }); 591// } 592 593//}); 594 595 596$(document).ready(function () { 597 $("#showcase").awShowcase( 598 { 599 content_width: 980, 600 content_height: 555, 601 fit_to_parent: false, 602 auto: false, 603 interval: 3000, 604 continuous: false, 605 loading: true, 606 tooltip_width: 200, 607 tooltip_icon_width: 32, 608 tooltip_icon_height: 32, 609 tooltip_offsetx: 18, 610 tooltip_offsety: 0, 611 arrows: true,
612 buttons: false, 613 btn_numbers: true, 614 keybord_keys: false, // By making it 'True'. It hangs the all pages by press right or left key; Zubair 615 mousetrace: false, /* Trace x and y coordinates for the mouse */ 616 pauseonover: true, 617 stoponclick: true, 618 transition: 'fade', /* hslide/vslide/fade */ 619 transition_delay: 300, 620 transition_speed: 500, 621 show_caption: 'onhover', /* onload/onhover/show */ 622 thumbnails: true, 623 thumbnails_position: 'outside-last', /* outside-last/outside-first/inside-last/inside-first */ 624 thumbnails_direction: 'horizontal', /* vertical/horizontal */ 625 thumbnails_slidex: 0, /* 0 = auto / 1 = slide one thumbnail / 2 = slide two thumbnails / etc. */ 626 dynamic_height: false, /* For dynamic height to work in webkit you need to set the width and height of images in the source. Usually works to only set the dimension of the first slide in the showcase. */ 627 speed_change: false, /* Set to true to prevent users from swithing more then one slide at once. */ 628 viewline: false /* If set to true content_width, thumbnails, transition and dynamic_height will be disabled. As for dynamic height you need to set the width and height of images in the source. */ 629 }); 630 631 if ($('#top01').length > 0) { 632 var container = document.getElementById('top01'); 633 var video = document.getElementById('player'); 634 var ratio = 9 / 16; //this is why the 56.25% padding hack exists 635 function resizer() { 636 var width = parseInt(window.getComputedStyle(container)['width'], 10); 637 var height = (width * ratio); 638 $(video).css('width', width + 'px'); 639 $(video).css('height', height + 'px'); 640 $(video).css('marginTop', '-3.278%'); 641 $(container).css('height', (height * 0.88) + 'px'); 642 } 643 window.addEventListener('resize', resizer, false); 644 resizer(); 645 } 646 647 648 var tag = document.createElement('script'); 649 tag.src = "https://www.youtube.com/iframe_api"; 650 var firstScriptTag = document.getElementsByTagName('script')[0]; 651 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); 652 653 if ($("#instafeed").length > 0) { 654 var feed = new Instafeed({ 655 get: 'user', 656 userId: 3034941601, 657 clientId: '39f82dab8fd14f458b7f7a9b66f98512', 658 accessToken: '3034941601.39f82da.e69c409390e54441b2ad62731e1be04f', 659 template: '<li><a href="{{link}}" target="_blank"><img src="{{image}}"></a></li>', 660 limit: '18', 661 resolution: 'standard_resolution', 662 after: function () { 663 var iw = $('#instafeed li').width(); 664 var ih = iw; 665 $('#instafeed li').css('height', ih); 666 } 667 }); 668 feed.run(); 669 } 670 671}); 672 673 674var player; 675function onYouTubeIframeAPIReady() { 676 player = new YT.Player('player', { 677 width: '100%', 678 height: '100%', 679 videoId: youtube_parser($("#hdnVideoUrl").val()), 680 wmode: 'transparent', 681 playerVars: { 682 loop: '1', 683 ratio: "9 / 16", 684 playlist: youtube_parser($("#hdnVideoUrl").val()), 685 rel: '0', 686 showinfo: '0', 687 autohide: '1', 688 controls: '0', 689 color: 'white', 690 modestbranding: '1', 691 autoplay: "1", 692 cc_load_policy: "1", 693 enablejsapi: "1" 694 }, 695 events: { 696 'onReady': onPlayerReady, 697 'onStateChange': onPlayerStateChange 698 } 699 700 }); 701} 702function onPlayerReady(event) { 703 event.target.playVideo(); 704 event.target.mute(); 705 $(".ytp-bezel .ytp-bezel-icon").css({'z-index': '-999 !important'}); 706 707} 708function onPlayerStateChange(event) { 709 var ytStatus = event.data; 710 if (ytStatus == YT.PlayerState.PAUSED) { 711 event.target.playVideo(); 712 } 713} 714 715function youtube_parser(url) { 716 if (url != undefined && url != "") { 717 var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/; 718 var match = url.match(regExp); 719 if (match && match[7].length == 11) { 720 return match[7]; 721 } else { 722 alert("Url Incorrect"); 723 } 724 } 725}
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.