1 2 3 4 5/********************************************* 6 * common.js 7 * ------------------------------------------- 8 * @namespace 9 * - HASEKO 10 * @constructor 11 * - Util(variable/method) 12 * :variable 13 * - $win 14 * - $doc 15 * - ua 16 * - SMART_UA 17 * - pagePath 18 * - pageW 19 * - breakPoint1 20 * - breakPoint2 21 * - responsive 22 * :method 23 * - isRangeSP 24 * - isRangeTL 25 * - isRangePC 26 * - isNotPC 27 * - isSmartphone 28 * - isTablet 29 * - isTouch 30 * - isIE 31 * - isIE8 32 * - isIE9 33 * - isIE10 34 * - isIE11 35 * - isStorage 36 * - isShutto 37 * - isFontSizeCheck 38 * - isWindowSizeCheck 39 * @module 40 * - respondDevice 41 * - respondBrowser 42 * - smartView 43 * - rollover 44 * - smoothScroll 45 * - pageTopControl 46 * - sizeFix 47 * - frameImg 48 * - swapImg 49 * - popup 50 * - printSet 51 * - accordion 52 * - tabSwitcher 53 * - tabSwitcher02 54 * - modalWindow 55 * - equalWidth 56 * - equalHeight 57 * - gNaviControl 58 * - bookmark 59 * - recommend 60 * - pickupSlider 61 * - spScrolltable 62 * @init 63 * @requires 64 * - jquery.js 65 * - jquery.plugin.js 66*********************************************/ 67 68/* ------------------------------------------- 69 * @namespace 70------------------------------------------- */ 71var HASEKO = HASEKO || {}; 72 73 74 75/* ------------------------------------------- 76 * @constructor 77------------------------------------------- */ 78HASEKO.Util = function(){ 79 this.$win = $(window); 80 this.$doc = $(document); 81 this.ua = navigator.userAgent.toLowerCase(); 82 this.SMART_UA = ["iphone","ipad","android","windows phone"]; 83 this.pagePath = location.pathname.replace('index.html', ''); 84 this.pageW = 1280; 85 this.breakPoint1 = 768; 86 this.breakPoint2 = 900; 87 this.responsive = false; 88}; 89 90HASEKO.Util.prototype = { 91 /* 92 * @method isRangeSP 93 * @return {Boolean} 94 */ 95 isRangeSP: function(){ 96 var winW = this.$win.width(), 97 innerW = window.innerWidth ? window.innerWidth: this.$win.width(), 98 outerW = window.outerWidth; 99 return (winW <= this.breakPoint1) ? true : false; 100 }, 101 102 /* 103 * @method isRangeTL 104 * @return {Boolean} 105 */ 106 isRangeTL: function(){ 107 var winW = this.$win.width(), 108 innerW = window.innerWidth ? window.innerWidth: this.$win.width(), 109 outerW = window.outerWidth; 110 //return ((this.breakPoint1 < winW) && (winW <= this.breakPoint2)) ? true : false; 111 //return ((this.breakPoint1 < innerW && this.breakPoint1 < outerW) && (innerW <= this.breakPoint2 && outerW <= this.breakPoint2)) ? true : false; 112 }, 113 114 /* 115 * @method isRangePC 116 * @return {Boolean} 117 */ 118 isRangePC: function(){ 119 var winW = this.$win.width(), 120 innerW = window.innerWidth ? window.innerWidth: this.$win.width(), 121 outerW = window.outerWidth; 122 return (this.breakPoint1 < winW) ? true : false; 123 }, 124 125 /* 126 * @method isNotPC 127 * @return {Boolean} 128 */ 129 isNotPC: function(){ 130 var uaArray = new RegExp(this.SMART_UA.join("|"),"i"); 131 return uaArray.test(this.ua); 132 }, 133 134 /* 135 * @method isSmartphone 136 * @return {Boolean} 137 */ 138 isSmartphone: function(){ 139 var UA = { 140 iPhone: this.ua.indexOf('iphone') != -1, 141 iPod: this.ua.indexOf('ipod') != -1, 142 Android: this.ua.indexOf('android') != -1 && this.ua.indexOf('mobile') != -1, 143 WindowsPhone: this.ua.indexOf('windows phone') != -1 144 } 145 return (UA.iPhone || UA.iPod || UA.Android || UA.WindowsPhone) ? true : false; 146 }, 147 148 /* 149 * @method isTablet 150 * @return {Boolean} 151 */ 152 isTablet: function(){ 153 var UA = { 154 iPad: this.ua.indexOf('ipad') != -1, 155 Android: this.ua.indexOf('android') != -1 && this.ua.indexOf('mobile') == -1 156 } 157 return (UA.iPad || UA.Android) ? true : false; 158 }, 159 160 /* 161 * @method isTouch 162 * @return {Boolean} 163 */ 164 isTouch: function(){ 165 return ('ontouchstart' in window) ? true : false; 166 }, 167 168 /* 169 * @method isIE 170 * @return {Boolean} 171 */ 172 isIE: function(){ 173 return (this.ua.indexOf("msie") != -1 || this.ua.indexOf("trident") != -1) ? true : false; 174 }, 175 /* 176 * @method isIE8 177 * @return {Boolean} 178 */ 179 isIE8: function(){ 180 return (this.ua.indexOf("msie 8") != -1) ? true : false; 181 }, 182 183 /* 184 * @method isIE9 185 * @return {Boolean} 186 */ 187 isIE9: function(){ 188 return (this.ua.indexOf("msie 9") != -1) ? true : false; 189 }, 190 191 /* 192 * @method isIE10 193 * @return {Boolean} 194 */ 195 isIE10: function(){ 196 return (this.ua.indexOf("msie 10") != -1) ? true : false; 197 }, 198 199 /* 200 * @method isIE11 201 * @return {Boolean} 202 */ 203 isIE11: function(){ 204 return ((this.ua.indexOf("rv 11") != -1 || this.ua.indexOf("rv:11") != -1) && (this.ua.indexOf("trident") != -1)) ? true : false; 205 }, 206 207 /* 208 * @method isStorage 209 * @return {Boolean} 210 */ 211 isStorage: function(){ 212 return window.localStorage ? (function(){ 213 try { 214 localStorage.setItem('check_key', 1); 215 var check_value = localStorage.getItem('check_key');
216 localStorage.removeItem('check_key'); 217 return (check_value == 1); 218 } catch(e) { 219 return false; 220 } 221 })() : false 222 }, 223 224 /* 225 * @method isShutto 226 * @return {Boolean} 227 */ 228 isShutto: function(){ 229 return ($("body").hasClass("shutto")) ? true : false; 230 }, 231 232 /* 233 * @method isFontSizeCheck 234 * @param {function} callback 235 * - ãã©ã³ããµã¤ãºã夿´ãããããcallbackãå®è¡ 236 */ 237 isFontSizeCheck: function(callback){ 238 var $elm, 239 HTML_FS_WATCHER = $('<div id="fontSizeWatcher"> </div>'), 240 watcherCssObj = { 241 position: "absolute", 242 top: "0", 243 display: "block", 244 padding: "0", 245 visibility: "hidden" 246 }, 247 currentSize = 0, 248 interval = 500; 249 250 // ç£è¦ç¨HTMLãçæãã 251 HTML_FS_WATCHER.css(watcherCssObj).appendTo("body"); 252 $elm = $("#fontSizeWatcher"); 253 254 // è¦ç´ ã®é«ããåå¾ 255 var getSize = function($elm){ return $elm.height(); }; 256 257 // è¦ç´ ã®é«ããæ¯è¼ãã¦ãç°ãªãã°callbackãå®è¡ 258 var fontSizeCheck = function(){ 259 var h = getSize($elm); 260 261 if(h === currentSize){ 262 return false; 263 } else { 264 currentSize = h; 265 callback(); 266 } 267 }; 268 setInterval(fontSizeCheck, interval); 269 }, 270 271 /* 272 * @method isWindowSizeCheck 273 * @param {function} callback 274 * - windowã®ãªãµã¤ãºå¦çãå®äºããããcallbackãå®è¡ 275 */ 276 isWindowSizeCheck: function(callback){ 277 var resize = false, 278 interval = 500; 279 280 this.$win.on("resize", function(){ 281 // ãªãµã¤ãºããã¦ããéã¯ä½ãããªã 282 if(resize !== false){ clearTimeout(resize); } 283 284 resize = setTimeout(function(){ 285 callback(); 286 }, interval); 287 }); 288 } 289 290}; 291 292 293 294/* ------------------------------------------- 295 * @module 296------------------------------------------- */ 297HASEKO.module = function(){ 298 var u = new HASEKO.Util(); 299 300 return { 301 /* 302 * @method initialize 303 * - åæå 304 */ 305 initialize: function(){ 306 this.respondDevice(); 307 this.respondBrowser(); 308 this.smartView(); 309 this.rollover(); 310 this.smoothScroll(); 311 this.pageTopControl(); 312 this.sizeFix(); 313 this.frameImg(); 314 this.swapImg(); 315 this.popup(); 316 this.accordion(); 317 this.tabSwitcher(); 318 this.tabSwitcher02(); 319 this.modalWindow(); 320 this.capWidth(); 321 this.changeBox(); 322 this.headerNews(); 323 this.spScrolltable(); 324 this.toggleBox(); 325 this.headerControl(); 326 this.spheaderControl(); 327 this.sideNavControl(); 328 this.gnavi(); 329 this.kinenLogo(); 330 this.moreBtn(); 331 //this.equalWidth(true, true); â»ãã¼ãæã«å®è¡ 332 //this.equalHeight(true, true); â»ãã¼ãæã«å®è¡ 333 //this.pickupSlider(); â»ã¹ããæã®ã¿å®è¡ï¼shutto対å¿ï¼ 334 335 }, 336 337 /* 338 * @method respondDevice 339 * - ããã¤ã¹å¯¾å¿ 340 */ 341 respondDevice: function(){ 342 /* ã¹ãã以å¤ã®å ´å */ 343 /*if(!u.isSmartphone()){ 344 // é»è©±çªå·ã®ãªã³ã¯åé¤ 345 $('a[href^="tel:"]').each(function(){ 346 $(this).find("> *").unwrap(); 347 }); 348 }*/ 349 /* PC以å¤ã®å ´å */ 350 if(u.isNotPC()){ 351 // CSSèª¿æ´ 352 $("#globalHeader").css({"position": "relative"}); 353 $("#globalContents").css({"marginTop": 0}); 354 $(".titleWrap").css({"backgroundPosition": "0 0"}); 355 $(".headerWrap01 #headerNavi .megaMenu").css({"backgroundPosition": "0 0"}); 356 } 357 /* Androidã¹ããã®å ´å */ 358 if(u.ua.indexOf('android') != -1 && u.ua.indexOf('mobile') != -1){ 359 // Android4ç³»ã®ãã°å¯¾å¿ 360 $("#headerInfo > .tagline").css("backgroundColor", "#fff") 361 } 362 }, 363 364 /* 365 * @method respondBrowser 366 * - ãã©ã¦ã¶å¯¾å¿ 367 */ 368 respondBrowser: function(){ 369 /* IE8ã®å ´å */ 370 if(u.isIE8()){ 371 // ééPNGå¯¾å¿ 372 $('img[src$="png"]').each(function(){ 373 $(this).css({ 374 "background": "transparent", 375 "filter": 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + $(this).attr("src") + '", sizingMethod="scale");' 376 }); 377 }); 378 } 379 /* IE8/IE9ã®å ´å */ 380 if(u.isIE8() || u.isIE9()){ 381 // cssPIEå¯¾å¿ 382 u.$win.on("load", function(){ 383 if(window.PIE){ 384 $(".pie").css({ 385 "position": "relative", 386 "zoom": 1 387 }).each(function(){ 388 PIE.attach(this); 389 });
390 } 391 }); 392 } 393 /* IEã®å ´å */ 394 if(u.isIE()){ 395 // æåå¯å¤å¯¾å¿ 396 $(".headerWrap01 #headerInfo .tagline strong").css("fontSize", "8pt"); 397 $(".headerWrap01 #headerInfo .utilMenu > li > a").css("fontSize", "9pt"); 398 $(".headerWrap01 #headerNavi .commonMenu > li.gNav01 > a, .headerWrap01 #headerNavi .commonMenu > li.gNav02 > a, .headerWrap01 #headerNavi .commonMenu > li.gNav03 > a").css("fontSize", "14pt"); 399 $(".headerWrap01 #headerNavi .commonMenu > li.gNav04 > a, .headerWrap01 #headerNavi .commonMenu > li.gNav05 > a, .headerWrap01 #headerNavi .commonMenu > li.gNav06 > a").css("fontSize", "11pt"); 400 } 401 /* Chromeã®å ´å */ 402 if(u.ua.indexOf('chrome') != -1){ 403 // remã®ãã°å¯¾å¿ 404 u.$win.on("load", function(){ 405 /*$("body").css({ 406 "fontSize": "14px", 407 "fontSize": "1.4rem" 408 });*/ 409 }); 410 } 411 }, 412 413 /* 414 * @method smartView 415 * - viewportå¯¾å¿ 416 */ 417 smartView: function(){ 418 var viewPoint = u.pageW; 419 420 if(u.isTablet()){ 421 //$("body").css("width", viewPoint + "px"); 422 //$("meta[name='viewport']").attr("content", "width=" + viewPoint); 423 } 424 }, 425 426 /* 427 * @method rollover 428 * - ãã¼ã«ãªã¼ãã¼ 429 */ 430 rollover: function(){ 431 /* vars 432 ------------------------------- */ 433 var $elm = $(".rollover"), 434 onSuffix = "on"; 435 436 if($elm.length === 0 || u.isNotPC()){ 437 return false; 438 } 439 440 /* function 441 ------------------------------- */ 442 var src = { 443 over: function($elm){return $elm.attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1" + onSuffix + "$2");}, 444 out: function($elm){return $elm.attr("src").replace(new RegExp("^(.+)" + onSuffix + "(\.[a-z]+)$" ), "$1$2");}, 445 preload: function($elm){return $elm.attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1" + onSuffix + "$2");} 446 }; 447 448 /* trigger 449 ------------------------------- */ 450 $elm 451 .hover(function(){ 452 $(this).attr("src", src.over($(this))); 453 }, function(){ 454 $(this).attr("src", src.out($(this))); 455 }) 456 .each(function(){ 457 $("<img>").attr("src", src.preload($(this))); 458 }); 459 }, 460 461 /* 462 * @method smoothScroll 463 * - ã¹ã ã¼ã¹ã¹ã¯ãã¼ã« 464 */ 465 smoothScroll: function(){ 466 /* vars 467 ------------------------------- */ 468 var $header = $("#globalHeader"), 469 noScrollClass = ".noScroll", 470 fixedName = "is-fixed", 471 fixHeight = 0, 472 adjustHeight = 3, 473 url = $(location).attr("href"), 474 hash = location.hash, 475 href, 476 anc, 477 position, 478 speed = 300, 479 easing = "swing"; 480 481 /* trigger 482 ------------------------------- */ 483 /* ã¹ã¯ãã¼ã«å¶å¾¡ */ 484 $("a[href^=#]").not("a[href=#], a[href^=#tab], a[href^=#cb_inline], " + noScrollClass + "").on("click", function(){ 485 href = $(this).attr("href"); 486 anc = $(href); 487 position = (href=="#pageContainer") ? 0 : anc.offset().top; 488 //fixHeight = $header.height(); 489 490 if(u.isNotPC() || u.isShutto()){ 491 position = position - adjustHeight; 492 } else { 493 if($header.hasClass(fixedName)){ 494 position = position - fixHeight - adjustHeight; 495 } else { 496 position = position - fixHeight - adjustHeight; 497 } 498 } 499 if(href=="#pageContainer"){ 500 position = 0; 501 } 502 503 $("html, body").animate({ 504 scrollTop: position 505 }, speed, easing); 506 507 return false; 508 }); 509 510 /* ãã¼ã¸é·ç§»ï¼ã¢ã³ã«ã¼ç§»åå¶å¾¡ */ 511 u.$win.on("load", function(){ 512 if(url.indexOf("#anc") != -1 || url.indexOf("#searchResult") != -1){ 513 anc = $(hash); 514 position = anc.offset().top; 515 //fixHeight = $header.height(); 516 517 if(u.isNotPC() || u.isShutto()){ 518 position = position - adjustHeight; 519 } else { 520 if($header.hasClass(fixedName)){ 521 position = position - fixHeight - adjustHeight; 522 } else { 523 position = position - fixHeight - adjustHeight; 524 } 525 } 526 527 $("html, body").animate({ 528 scrollTop: position 529 }, speed, easing); 530 } 531 }); 532 }, 533 534 /* 535 * @method pageTopControl 536 * - ããã¼ã¸ãããããã¿ã³å¶å¾¡ 537 */ 538 pageTopControl: function(){ 539 /* vars 540 ------------------------------- */ 541 var $elm = $(".pageTopBtn"), 542 winH, 543 docH, 544 scrollY, 545 posY, 546 fadeSpeed = 500; 547 548 if($elm.length == 0){ 549 return false; 550 } 551 552 /* setting 553 ------------------------------- */ 554 // åæé表示 555 $elm.hide(); 556 557 /* trigger 558 ------------------------------- */ 559 // ã¹ã¯ãã¼ã«å¶å¾¡ 560 u.$win.on("scroll", function(){ 561 winH = u.$win.height(); 562 docH = u.$doc.height(); 563 // ã¹ã¯ãã¼ã«ããé«ãåå¾
564 scrollY = $(this).scrollTop(); 565 // ç¾å¨ã®ãããããã®ä½ç½®åå¾ 566 posY = winH + scrollY; 567 568 // 表示è¨å® 569 if($(this).scrollTop() > 100){ 570 $elm.fadeIn(fadeSpeed); 571 } else { 572 $elm.fadeOut(fadeSpeed); 573 } 574 575 // é ç½®è¨å® 576 /*if(docH - posY <= footerH){ 577 $elm.addClass(fixedName); 578 } else { 579 $elm.removeClass(fixedName); 580 }*/ 581 }); 582 }, 583 584 /* 585 * @method sizeFix 586 * - å¹ åºå® 587 */ 588 sizeFix: function(){ 589 /* vars 590 ------------------------------- */ 591 var $elm = $(".sizeFix"), 592 baseName = "baseSize", 593 captionName = "txCaption", 594 setW; 595 596 if($elm.length == 0){ 597 return false; 598 } 599 if(u.responsive && u.isSmartphone()){ 600 return false; 601 } 602 603 /* function 604 ------------------------------- */ 605 var sizeSet = function(target){ 606 if(u.isSmartphone()){ 607 setW = "auto"; 608 } else { 609 if(target.find("img").hasClass(baseName)){ 610 setW = $("." + c.baseName, target).width(); 611 } else { 612 setW = $("img", target).width(); 613 } 614 } 615 $('[class*="' + captionName + '"]', target).css("width", setW); 616 target.css("width", setW); 617 }; 618 619 /* trigger 620 ------------------------------- */ 621 $elm.each(function(){ 622 var self = $(this); 623 624 // ãã¼ãæ 625 u.$win.on("load", function(){ 626 sizeSet(self); 627 }); 628 // ãªãµã¤ãºæ 629 u.$win.on("orientationchange resize", function(){ 630 sizeSet(self); 631 }); 632 }) 633 }, 634 635 /* 636 * @method frameImg 637 * - ç»åæ è¨å® 638 */ 639 frameImg: function(){ 640 /* vars 641 ------------------------------- */ 642 var $elm = $(".imgFrame"); 643 644 if($elm.length == 0){ 645 return false; 646 } 647 648 $elm.each(function(){ 649 var self = $(this), 650 type = self.attr("class").replace('imgFrame ', ''); 651 652 self.removeClass(type).wrap('<span class="imgWrap ' + type + '"></span>'); 653 }); 654 }, 655 656 /* 657 * @method swapImg 658 * - ã¦ã£ã³ãã¦å¹ ã§ç»ååãæ¿ã 659 */ 660 swapImg: function(){ 661 /* vars 662 ------------------------------- */ 663 var $elm = $(".swap"), 664 pcPrefixName = "pc_", 665 spPrefixName = "sp_"; 666 667 if($elm.length == 0){ 668 return false; 669 } 670 671 /* function 672 ------------------------------- */ 673 var swap = function(img){ 674 if(u.isRangeSP()){ 675 img.attr("src", img.attr("src").replace(pcPrefixName, spPrefixName)); 676 } else { 677 img.attr("src", img.attr("src").replace(spPrefixName, pcPrefixName)); 678 } 679 }; 680 681 /* trigger 682 ------------------------------- */ 683 $elm.each(function(){ 684 var self = $(this); 685 686 // ãã¼ãæ 687 u.$win.on("load", function(){ 688 swap(self); 689 }); 690 // ãªãµã¤ãºæ 691 u.$win.on("orientationchange resize", function(){ 692 swap(self); 693 }); 694 }); 695 }, 696 697 /* 698 * @method popup 699 * - ãããã¢ãã 700 */ 701 popup: function(config){ 702 /* options 703 ------------------------------- */ 704 var c = $.extend({ 705 targetElm: ".popup", 706 popW: 600, 707 popH: 600 708 }, config); 709 710 /* vars 711 ------------------------------- */ 712 var $elm = $(c.targetElm); 713 714 if($elm.length === 0){ 715 return false; 716 } 717 718 /* trigger 719 ------------------------------- */ 720 $elm.each(function(){ 721 var self = $(this), 722 name = "POPUP", 723 width = c.popW, 724 height = c.popH, 725 menubar = "no", 726 toolbar = "no", 727 location = "yes", 728 status = "yes", 729 scrollbars = "yes", 730 resizable = "yes", 731 left = 0, 732 top = 0, 733 parameters, 734 center = false; 735 736 // ãããã¢ããã天å°å·¦å³ä¸å¤®ã«é ç½®ããå ´å 737 if(center){ 738 top = (screen.height - height) / 2; 739 left = (screen.width - width) / 2; 740 } 741 742 parameters = "width=" + width + ",height=" + height + ",menubar=" + menubar + ",toolbar=" + toolbar + ",location=" + location + ",status=" + status + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",left=" + left + ",screenX=" + left + ",top=" + top + ",screenY=" + top; 743 744 self.on("click", function(){ 745 window.open(self.href, name, parameters); 746 return false; 747 }) 748 }); 749 }, 750 751 752 753 /* 754 * @method accordion 755 * - ã¢ã³ã¼ãã£ãªã³ 756 */ 757 accordion: function(config){ 758 /* options 759 ------------------------------- */ 760 var c = $.extend({ 761 targetElm: ".toggleWrap01", 762 dispType: "allHide", // åæè¡¨ç¤ºè¨å®ï¼ãallHideãorãallShowãorãselectã 763 firstDisplay: 0, // åæè¡¨ç¤ºå¯¾è±¡ 764 toggleBtnClass: ".toggleBtn", // ééãã¿ã³ 765 togglePanelClass: ".togglePanel", // ééããã« 766 relType: "brother", // ééãã¿ã³ï¼ã¯ãªãã¯ã¨ãªã¢ï¼ã¨ééããã«ã®ä½ç½®é¢ä¿ï¼ãparent_childãorãbrotherã 767 switchClassName: "active", // åãæ¿ãã¯ã©ã¹ 768 closeBtnClass: ".closeBtn", // ãéããããã¿ã³ 769 slideSpeed : 200 // ã¹ã©ã¤ãã¹ãã¼ã 770 }, config); 771 772 /* vars 773 ------------------------------- */ 774 var $elm = $(c.targetElm), 775 toggleBtn = $(c.toggleBtnClass, $elm), 776 togglePanel = $(c.togglePanelClass, $elm), 777 targetBtn, 778 targetPanel, 779 isRelBorther; 780 781 if($elm.length == 0){ 782 return false; 783 } 784 785 /* settings 786 ------------------------------- */ 787 /* ééãã¿ã³ï¼ã¯ãªãã¯ã¨ãªã¢ï¼ã¨ééããã«ã®ä½ç½®é¢ä¿ãå å¼é¢ä¿ãã©ãã */ 788 if(c.relType == "parent_child"){ 789 isRelBorther = false; 790 } else if(c.relType == "brother"){ 791 isRelBorther = true; 792 } 793 794 /* åæè¡¨ç¤ºè¨å® */ 795 switch(c.dispType) { 796 // å ¨é表示ã®å ´å 797 case "allHide": 798 togglePanel.hide(); 799 break; 800 // å ¨è¡¨ç¤ºã®å ´å 801 case "allShow": 802 if(isRelBorther){ 803 toggleBtn.addClass(c.switchClassName); 804 } else { 805 toggleBtn.find("a").addClass(c.switchClassName); 806 } 807 break; 808 // 1ã¤ã ã表示ããå ´å 809 case "select": 810 if(isRelBorther){ 811 toggleBtn.eq(c.firstDisplay).addClass(c.switchClassName); 812 } else { 813 toggleBtn.eq(c.firstDisplay).find("a").addClass(c.switchClassName); 814 } 815 togglePanel.hide(); 816 togglePanel.eq(c.firstDisplay).show(); 817 break; 818 default: 819 break; 820 } 821 822 /* trigger 823 ------------------------------- */ 824 toggleBtn.each(function(){ 825 if(isRelBorther){ 826 $(this).on("click", function(){ 827 targetBtn = $(this); 828 targetPanel = targetBtn.next(); 829 830 targetBtn.toggleClass(c.switchClassName); 831 targetPanel.slideToggle(c.slideSpeed); 832 833 // é«ãæãå®è¡ 834 HASEKO.module.equalHeight(); 835 });
836 } else { 837 $(this).on("click", "a", function(){ 838 targetBtn = $(this).parent(c.toggleBtnClass); 839 targetPanel = targetBtn.next(); 840 841 targetBtn.find("a").toggleClass(c.switchClassName); 842 targetPanel.slideToggle(c.slideSpeed); 843 844 // é«ãæãå®è¡ 845 HASEKO.module.equalHeight(); 846 }); 847 } 848 }); 849 850 /* ãéããããã¿ã³å¶å¾¡ */ 851 $(c.closeBtnClass).on("click", "a", function(){ 852 targetPanel = $(this).parents(c.togglePanelClass); 853 targetBtn = targetPanel.prev(); 854 855 targetPanel.slideUp(c.slideSpeed); 856 if(isRelBorther){ 857 targetBtn.removeClass(c.switchClassName); 858 } else { 859 targetBtn.find("a").removeClass(c.switchClassName); 860 } 861 }); 862 }, 863 864 /* 865 * @method tabSwitcher 866 * - ã¿ãåãæ¿ã 867 */ 868 tabSwitcher: function(config){ 869 /* options 870 ------------------------------- */ 871 872 /* vars 873 ------------------------------- */ 874 var $tabSelect = $('.tabBox .tabList li'), 875 $tabContents = $('.tabDetail'); 876 877 /* function 878 ------------------------------- */ 879 880 881 //é常ã¿ãåãæ¿ã 882 $(function() { 883 $tabSelect.click(function() { 884 var index = $(this).closest(".tabBox").find(".tabList").find("li").index(this); 885 $(this).closest(".tabBox").find(".tabDetail").css('display','none'); 886 $(this).closest(".tabBox").find(".tabDetail").eq(index).css('display','block'); 887 $(this).closest(".tabBox").find(".tabList").find("li").removeClass('select'); 888 $(this).addClass('select'); 889 }); 890 }); 891 892 //ãã¤ã¬ã¯ããªã³ã¯ 893 $(function() { 894 $tabContents.css('display','none'); 895 $tabSelect.removeClass('select'); 896 var allTabNum = $(".tabBox").size(); 897 898 $(".tabBox").each(function(index){ 899 if($(".tabBox").eq(index).hasClass("tab_beginning_set")){ 900 var attr_index = $(".tabBox").eq(index).attr("data-beginning-index"); 901 $(".tabBox").eq(index).find(".tabList").find("li").eq(attr_index - 1).addClass("select"); 902 $(".tabBox").eq(index).find(".tabDetail").eq(attr_index - 1).css('display','block'); 903 }else{ 904 $(".tabBox").eq(index).find(".tabList").find("li").eq(0).addClass("select"); 905 $(".tabBox").eq(index).find(".tabDetail").eq(0).css('display','block'); 906 } 907 }); 908 909 910 var hash = location.hash; 911 hash = (hash.match(/^#tab\d+$/) || [])[0]; 912 913 if($(hash).length){ 914 var tabname = hash.slice(1); 915 var tabno =$('.tabBox .tabList li#' + tabname).closest("ul").find("li").index($('.tabBox .tabList li#' + tabname)); 916 917 $('.tabBox .tabList li#' + tabname).closest("ul").find("li").removeClass('select'); 918 $('.tabBox .tabList li#' + tabname).closest(".tabBox").find(".tabDetail").css('display','none'); 919 920 $('.tabBox .tabList li#' + tabname).closest(".tabBox").find(".tabDetail").eq(tabno).css('display','block'); 921 $('.tabBox .tabList li#' + tabname).addClass("select"); 922 923 }else{ 924 //var tabname = "tab01"; 925 926 } 927 928 929 930 }); 931 }, 932 933 /* 934 * @method tabSwitcher02 935 * - ã¿ãåãæ¿ãï¼/area/ç¨ï¼ 936 */ 937 tabSwitcher02: function(){ 938 /* vars 939 ------------------------------- */ 940 var $elm = $('.js-areaTabs'), 941 $tabNavi = $elm.find(".js-areaTabs_navi"), 942 $tabTrigger = $tabNavi.find(".js-areaTabs_trigger"), 943 $detail = $elm.find(".js-areaTabs_detail"), 944 $anchorLink = $(".areaAnchorLink"), 945 $anchorTrigger = $anchorLink.find("a"), 946 activeClass = "is-active"; 947 948 /* function 949 ------------------------------- */ 950 if($elm.length == 0){ return false; } 951 952 $(function(){ 953 // åæç¶æ 954 $tabNavi.find("li").eq(0).addClass(activeClass); 955 $detail.hide(); 956 $detail.eq(0).show(); 957 958 // ã¿ãåãæ¿ã 959 $tabTrigger.on('click', function(){ 960 var trigger = $(this), 961 targetPanel = trigger.attr('href'); 962 if(trigger.parent().hasClass(activeClass)){ 963 return false; 964 } else { 965 $tabNavi.find('li').removeClass(activeClass); 966 $tabNavi.find('a[href="' + targetPanel + '"]').parent().addClass(activeClass); 967 $detail.show().not(targetPanel).hide(); 968 return false; 969 } 970 }); 971 972 // å°å³ã¢ã³ã«ã¼ã«ããã¿ãåãæ¿ã 973 $anchorTrigger.on('click', function(){ 974 var trigger = $(this), 975 targetData = trigger.data('area-anchor'), 976 targetPanel = "#" + targetData; 977 $tabNavi.find('li').removeClass(activeClass); 978 $tabNavi.find('a[href="' + targetPanel + '"]').parent().addClass(activeClass); 979 $detail.show().not(targetPanel).hide(); 980 }); 981 }); 982 }, 983 984 /* 985 * @method modalWindow 986 * - ã¢ã¼ãã«å±é 987 */ 988 modalWindow: function(config){ 989 990 /* function 991 ------------------------------- */ 992 $(function(){ 993 $('.modalBtn .inner').css('display', 'none'); 994 if(!u.isSmartphone()){ //PCã»Tabletã®å ´å 995 //ã¹ã©ã¤ãã¼ç¡ã¢ã¼ãã« 996 $('.modalOpen').colorbox({ 997 inline:true, 998 width: 900, 999 onOpen: function(){ 1000 1001 } 1002 });
1003 $('.modalOpen2').colorbox({ 1004 inline:true, 1005 width: 1100, 1006 onOpen: function(){ 1007 1008 } 1009 }); 1010 $('.modalimg').colorbox({ 1011 onOpen: function(){ 1012 1013 } 1014 }); 1015 //ã¹ã©ã¤ãã¼æã¢ã¼ãã« 1016 $('.modalSlideOpen').click(function(){ 1017 var getId = $(this).attr('href'), 1018 findSrc = $(getId).html(); 1019 1020 $(this).colorbox({ 1021 inline:true, 1022 width: 900, 1023 onOpen: function(){ 1024 $(getId).parent().css('display', 'block') 1025 var slider = $(getId+' .slider ul').bxSlider({ 1026 auto: false, 1027 controls: false, 1028 slideWidth: 820, 1029 maxSlides: 1, 1030 moveSlides: 1, 1031 speed: 500 1032 }); 1033 }, 1034 onClosed: function(){ 1035 $(getId).parent().css('display', 'none'); 1036 $(getId).html(findSrc); 1037 } 1038 }); 1039 }); 1040 1041 $('.modalSlideOpen2').click(function(){ 1042 var getId = $(this).attr('href'), 1043 findSrc = $(getId).html(); 1044 1045 $(this).colorbox({ 1046 inline:true, 1047 width: 1100, 1048 onOpen: function(){ 1049 $(getId).parent().css('display', 'block') 1050 var slider = $(getId+' .modal_slider ul.modal_sliderBox').bxSlider({ 1051 auto: false, 1052 slideWidth: 520, 1053 maxSlides: 1, 1054 moveSlides: 1, 1055 speed: 500 1056 });
1057 }, 1058 onClosed: function(){ 1059 $(getId).parent().css('display', 'none'); 1060 $(getId).html(findSrc); 1061 } 1062 }); 1063 }); 1064 1065 $('.modalSlideOpen2_long').click(function(){ 1066 var getId = $(this).attr('href'), 1067 findSrc = $(getId).html(); 1068 1069 $(this).colorbox({ 1070 inline:true, 1071 width: 1100, 1072 onOpen: function(){ 1073 $(getId).parent().css('display', 'block') 1074 var slider = $(getId+' .modal_slider ul.modal_sliderBox').bxSlider({ 1075 auto: false, 1076 slideWidth: 1018, 1077 maxSlides: 1, 1078 moveSlides: 1, 1079 speed: 500 1080 }); 1081 }, 1082 onClosed: function(){ 1083 $(getId).parent().css('display', 'none'); 1084 $(getId).html(findSrc); 1085 } 1086 }); 1087 }); 1088 1089 1090 } else { //SPã®å ´å 1091 //ã¹ã©ã¤ãã¼ç¡ã¢ã¼ãã« 1092 $('.modalOpen').colorbox({ 1093 inline:true, 1094 width: '89.5%'//, 1095// onOpen: function(){ //ã¿ãé·ç§»å±é 1096// var getId = $(this).attr('href'); 1097// if($(this).hasClass('tabSwitch')){ 1098// $(getId+' .tabBox').find(".tabList").find('li').toggleClass('select'); 1099// $(getId+' .tabBox').find(".tabDetail").toggle();
1100// } 1101// }, 1102 }); 1103 $('.modalOpen2').colorbox({ 1104 inline:true, 1105 width: '89.5%' 1106 }); 1107 $('.modalimg').colorbox({ 1108 width: '89.5%' 1109 }); 1110 //ã¹ã©ã¤ãã¼æã¢ã¼ãã« 1111 $('.modalSlideOpen').click(function(){ 1112 var getId = $(this).attr('href'), 1113 findSrc = $(getId).html(); 1114 $(this).colorbox({ 1115 inline:true, 1116 width: '89.5%', 1117 onOpen: function(){ 1118 $(getId).parent().css('display', 'block'); 1119 var slideWidth = $(window).width() * 0.895 - 44 - 0, 1120 setWidth = Math.floor(slideWidth); 1121 var slideWidthNow = slideWidth; 1122 var slider = $(getId+' .slider ul').bxSlider({ 1123 auto: false, 1124 slideWidth: slideWidthNow, 1125 maxSlides: 1, 1126 moveSlides: 1, 1127 speed: 500, 1128 controls: false, 1129 touchEnabled:false 1130 }); 1131 $('.bx-viewport .colTwo').width(setWidth); 1132 //var slideHeight = $('.bx-viewport .colTwo').height(); 1133 //alert(slideHeight); 1134 }, 1135 onClosed: function(){ 1136 $(getId).parent().css('display', 'none'); 1137 $(getId).html(findSrc); 1138 } 1139 }); 1140 }); 1141 1142 1143 1144 $('.modalSlideOpen2').click(function(){ 1145 var getId = $(this).attr('href'), 1146 findSrc = $(getId).html(); 1147 $(this).colorbox({ 1148 inline:true, 1149 width: '89.5%', 1150 onOpen: function(){ 1151 var slideMwi = $(window).width() * 0.895 - 42; 1152 $('.modal_slider').append("<style>.modal_sliderBox li{width: " + slideMwi + "px !important;}</style>"); 1153 $(getId).parent().css('display', 'block'); 1154 var slideWidth = $(window).width() * 0.895 - 44 - 60, 1155 setWidth = Math.floor(slideWidth); 1156 var slideWidthNow = slideWidth; 1157 var slider = $(getId+' .modal_slider ul.modal_sliderBox').bxSlider({ 1158 auto: false, 1159 slideWidth: slideMwi, 1160 maxSlides: 1, 1161 moveSlides: 1, 1162 speed: 500 1163 });
1164 $('.bx-viewport .colTwo').width(setWidth); 1165 //var slideHeight = $('.bx-viewport .colTwo').height(); 1166 //alert(slideHeight); 1167 }, 1168 onClosed: function(){ 1169 $(getId).parent().css('display', 'none'); 1170 $(getId).html(findSrc); 1171 } 1172 }); 1173 }); 1174 1175 1176 $('.modalSlideOpen2_long').click(function(){ 1177 var getId = $(this).attr('href'), 1178 findSrc = $(getId).html(); 1179 $(this).colorbox({ 1180 inline:true, 1181 width: '89.5%', 1182 onOpen: function(){ 1183 var slideMwi = $(window).width() * 0.895 - 42; 1184 $('.modal_slider').append("<style>.modal_sliderBox li{width: " + slideMwi + "px !important;}</style>"); 1185 $(getId).parent().css('display', 'block'); 1186 var slideWidth = $(window).width() * 0.895 - 44 - 60, 1187 setWidth = Math.floor(slideWidth); 1188 var slideWidthNow = slideWidth; 1189 var slider = $(getId+' .modal_slider ul.modal_sliderBox').bxSlider({ 1190 auto: false, 1191 slideWidth: slideMwi, 1192 maxSlides: 1, 1193 moveSlides: 1, 1194 speed: 500 1195 });
1196 $('.bx-viewport .colTwo').width(setWidth); 1197 //var slideHeight = $('.bx-viewport .colTwo').height(); 1198 //alert(slideHeight); 1199 }, 1200 onClosed: function(){ 1201 $(getId).parent().css('display', 'none'); 1202 $(getId).html(findSrc); 1203 } 1204 }); 1205 }); 1206 1207 1208 } 1209 }); 1210 }, 1211 1212 1213 /* 1214 * @headerNews 1215 * - ãããã¼ãã¥ã¼ã¹è¡¨ç¤ºã¨ãªã¢ 1216 */ 1217 headerNews: function(config){ 1218 1219 /* function 1220 ------------------------------- */ 1221 if($("#globalHeader").hasClass("bizsearch_site_only")){ 1222 $(".bizsearch_site_none").remove(); 1223 }else{ 1224 $("#gNav > ul > li > .menuInner .menuBox .newsArea").append("<ul></ul>"); 1225 $.ajax({ 1226 url: "/hc/ir/js/ir_news.json" , 1227 dataType : 'json' , 1228 success : 1229 function(json){ 1230 var len = json.length; 1231 var maxsize = 5 ; 1232 1233 if(len > 5){ 1234 var len = 5 ; 1235 } 1236 1237 if(len < 1){ 1238 $("#gNav > ul > li > .menuInner .menuBox .newsArea").html("<p>ç¾å¨ãã¥ã¼ã¹ã¯ããã¾ããã</p>"); 1239 }else{ 1240 for(var i=0; i < len; i++){ 1241 1242 1243 //link 1244 var url = json[i].url; 1245 if(url == ""){ 1246 var urlSet = 'noLink'; 1247 }else{ 1248 var urlSet = 'link'; 1249 } 1250 1251 //blank 1252 var blank = json[i].blank; 1253 if(blank == "T"){ 1254 var blankSet = 'target="_blank"'; 1255 }else{ 1256 var blankSet = ''; 1257 } 1258 1259 //size 1260 var size = json[i].size; 1261 if(size == ""){ 1262 var sizeSet = ''; 1263 }else{ 1264 var sizeSet = '[PDFï¼' + size + ']'; 1265 } 1266 1267 if(urlSet == "noLink"){ 1268 $("#gNav > ul > li > .menuInner .menuBox .newsArea ul").append( '<li><span><p class="data">' + json[i].date + '</p><p class="detail">' + json[i].detail + sizeSet + '</p></span></li>'); 1269 }else{ 1270 $("#gNav > ul > li > .menuInner .menuBox .newsArea ul").append( '<li><a href="' + json[i].url + '" ' + blankSet + '><p class="data">' + json[i].date + '</p><p class="detail">' + json[i].detail + sizeSet + '</p></a></li>'); 1271 } 1272 1273 1274 } 1275 } 1276 } 1277 1278 //json[i].date 1279}); 1280 1281 1282 } 1283 }, 1284 1285 1286 /* 1287 * @method capWidth 1288 * - ãã£ãã·ã§ã³æã 1289 */ 1290 capWidth: function(config){ 1291 1292 /* function 1293 ------------------------------- */ 1294 //cap width 1295 $(window).load(function () { 1296 var capSize = $(".photo").size(); 1297 for(var i=0;i<capSize;i++){ 1298 photoW = $(".photo").eq(i).children("img").width(); 1299 $(".photo").eq(i).next(".imgCap").css("width",photoW); 1300 } 1301 }); 1302 }, 1303 1304 1305 /* 1306 * @method capWidth 1307 * - ã¹ããæã«ç»åã¨ããã¹ãå転 1308 */ 1309 changeBox: function(config){ 1310 1311 /* function 1312 ------------------------------- */ 1313 if(u.isSmartphone()){ 1314 var changeSize = $(".photoColumn.changeBox").size(); 1315 for(var i=0;i<changeSize;i++){ 1316 changeBoxPhoto = $(".photoColumn.changeBox").eq(i).find(".photoCol").prop("outerHTML"); 1317 $(".photoColumn.changeBox").eq(i).find(".photoCol").remove(); 1318 $(".photoColumn.changeBox").eq(i).append(changeBoxPhoto); 1319 } 1320 } 1321 }, 1322 1323 1324 /* 1325 * @method spScrolltable 1326 * - ã¹ããæã«ç»åã¨ããã¹ãå転 1327 */ 1328 spScrolltable: function(config){ 1329 var c = $.extend({ 1330 targetElm: ".table.scroll", 1331 fixedType01: "leftFix", 1332 fixedType02: "topFix", 1333 cloneClass: "cloneElm", 1334 fixedCell: ".sp_fixed" 1335 1336 }, config); 1337 1338 /* function 1339 ------------------------------- */ 1340 $(c.targetElm).each(function(){ 1341 if($(this).hasClass(c.fixedType01)){ 1342 var $table = $(this).find("table"); 1343 var innerW = $table.find("tr > th:first-child").outerWidth(); 1344 1345 $table.find(c.fixedCell).each(function(index){ 1346 var innerH = $(this).find("th:first-child").outerHeight(); 1347 $(this).attr("data-Height",innerH+"px"); 1348 $(this).find("th:first-child").height(innerH+"px"); 1349 }); 1350 1351 var clone = $table.prop('outerHTML'); 1352 $table.before(clone).prev("table").wrap('<div class="table '+c.cloneClass+'" style="width:'+innerW+'px;"></div>').find("tr").not(c.fixedCell).remove(); 1353 $table.prev(".cloneElm").find("colgroup").remove(); 1354 $table.prev(".cloneElm").find("table tr > *:not(:first-child)").remove(); 1355 $table.prev(".cloneElm").find("table tr").each(function(){ 1356 $(this).height($(this).attr("data-Height")); 1357 $(this).find("*").width(innerW); 1358 });
1359 1360 } 1361 }); 1362 1363 1364 }, 1365 1366 /* 1367 * @method toggleBox 1368 * - ééããã¯ã¹ 1369 */ 1370 toggleBox: function(config){ 1371 $('.toggleBox > dl > dt').click(function() { 1372 $(this).toggleClass("openNow"); 1373 $(this).next("dd").slideToggle(300); 1374 HASEKO.module.equalHeight(true, true); 1375 }); 1376 1377 }, 1378 1379 /* 1380 * @method moreBtn 1381 * - ããã«è¡¨ç¤º 1382 */ 1383 moreBtn : function(){ 1384 var moreBtn = $(".moreBtn"), 1385 columnDate = $(".columnData.columnBox .column").length; 1386 1387 $(".columnData").each(function(){ 1388 var Num = 9; 1389 if (columnDate <= Num) { 1390 moreBtn.hide(); 1391 } else { 1392 $(this).find(".column:gt(8)").each(function(){$(this).hide();}); 1393 } 1394 moreBtn.click(function(){ 1395 Num +=9; 1396 $(this).parent().find(".column:lt("+Num+")").show(300); 1397 if (columnDate <= Num) { 1398 moreBtn.hide(); 1399 } 1400 }); 1401 }); 1402 }, 1403 1404 1405 /* 1406 * @method gnavi 1407 * - gnavi 1408 */ 1409 gnavi: function(config){ 1410//ã°ããã 1411$(function(){ 1412 var nowLocate = location.pathname; 1413 var pointpath = nowLocate.split("/")[2]; 1414 1415 if(pointpath == "company"){ 1416 $("#gNav > ul > li").eq(0).addClass("current"); 1417 }else if(pointpath == "technology"){ 1418 $("#gNav > ul > li").eq(1).addClass("current"); 1419 }else if(pointpath == "ir"){ 1420 $("#gNav > ul > li").eq(2).addClass("current"); 1421 }else if(pointpath == "csr"){ 1422 $("#gNav > ul > li").eq(3).addClass("current"); 1423 }else if(pointpath == "recruit"){ 1424 $("#gNav > ul > li").eq(4).addClass("current"); 1425 } 1426 1427}); 1428 1429 }, 1430 1431 1432 1433 /* 1434 * @method gnavi 1435 * - kinenLogo 1436 */ 1437 kinenLogo: function(config){ 1438 //kinenLogo 1439 $(function(){ 1440 $("#sidebar").append 1441 }); 1442 1443 }, 1444 1445 1446 1447 /* 1448 * @method equalWidth 1449 * - å¹ æã 1450 * @param {Boolean} 1451 * - æåå¯å¤ã»ãªãµã¤ãºã«å¯¾å¿ãããã©ãã 1452 */ 1453 equalWidth: function(fsCheck, wsCheck){ 1454 /* vars 1455 ------------------------------- */ 1456 var $elm = $(".equalWidth"), 1457 $children = $elm.children(), 1458 childBaseName = "eqChild", 1459 fsCheck = fsCheck || false, 1460 wsCheck = wsCheck || false; 1461 1462 if($elm.length === 0 || $children.length < 2){ 1463 return false; 1464 } 1465 1466 /* function 1467 ------------------------------- */ 1468 /* åè¦ç´ ãã¨ã«ã°ã«ã¼ãå */ 1469 var grouping = function(){ 1470 var $groupedChildren = $elm.find('*[class*=' + childBaseName + ']'), 1471 classNames = {},groups = []; 1472 1473 $groupedChildren.each(function(){ 1474 var splitClass = $(this).attr("class").split(" "), 1475 splitClassNum = splitClass.length, 1476 newClassName; 1477 1478 for(var i = 0; i < splitClassNum; i++){ 1479 newClassName = splitClass[i].match(RegExp(childBaseName + "[a-z0-9]+", 'i')); 1480 1481 if(!newClassName){ 1482 continue; 1483 } else { 1484 newClassName.toString(); 1485 classNames[newClassName] = newClassName; 1486 } 1487 } 1488 }); 1489 1490 for(var c in classNames){ 1491 groups.push($elm.find("." + c)); 1492 } 1493 groups.push($children); 1494 1495 return groups; 1496 }; 1497 1498 /* åè¦ç´ ã®å¹ ãæãã */ 1499 var equalWidth = function(elm){ 1500 var maxWidth = 0; 1501 elm.css("width", "auto"); 1502 1503 elm.each(function(){ 1504 if($(this).width() > maxWidth){ 1505 maxWidth = $(this).width() + 5; 1506 } 1507 1508 }); 1509 return elm.width(maxWidth); 1510 }; 1511 1512 /* init */ 1513 var init = function(){ 1514 var groups = grouping(), 1515 w = [], 1516 child = [], 1517 maxWidth = 0; 1518 1519 $.each(groups, function(){ 1520 var $group = $(this); 1521 1522 $group.each(function(i){ 1523 $(this).css("width", "auto"); 1524 w[i] = $(this).width(); 1525 1526 child.push(this); 1527 }); 1528 }); 1529 if(child.length > 1){ equalWidth($(child)); } 1530 }; 1531 1532 /* init 1533 ------------------------------- */ 1534 // æåå¯å¤ã»ãªãµã¤ãºã¸ã®å¯¾å¿å¯å¦ 1535 fsCheck ? u.isFontSizeCheck(init) : init(); 1536 wsCheck ? u.isWindowSizeCheck(init) : init(); 1537 }, 1538 1539 /* 1540 * @method equalHeight 1541 * - é«ãæã 1542 * @param {Boolean} 1543 * - æåå¯å¤ã»ãªãµã¤ãºã«å¯¾å¿ãããã©ãã 1544 */ 1545 equalHeight: function(fsCheck, wsCheck){ 1546 /* vars 1547 ------------------------------- */ 1548 var $elm = $(".equalHeight"), 1549 $children = $elm.children(), 1550 childBaseName = "eqChild", 1551 cancelName = "smart-cancel", 1552 fsCheck = fsCheck || false, 1553 wsCheck = wsCheck || false; 1554 1555 if($elm.length === 0 || $children.length < 2){ 1556 return false; 1557 } 1558 1559 /* function 1560 ------------------------------- */ 1561 /* åè¦ç´ ãã¨ã«ã°ã«ã¼ãå */ 1562 var grouping = function(){ 1563 var $groupedChildren = $elm.find('*[class*=' + childBaseName + ']'), 1564 classNames = {},groups = []; 1565 1566 $groupedChildren.each(function(){ 1567 var splitClass = $(this).attr("class").split(" "), 1568 splitClassNum = splitClass.length, 1569 newClassName; 1570 1571 for(var i = 0; i < splitClassNum; i++){ 1572 newClassName = splitClass[i].match(RegExp(childBaseName + "[a-z0-9]+", 'i')); 1573 1574 if(!newClassName){ 1575 continue; 1576 } else { 1577 newClassName.toString(); 1578 classNames[newClassName] = newClassName; 1579 } 1580 } 1581 }); 1582 1583 for(var c in classNames){ 1584 groups.push($elm.find("." + c)); 1585 } 1586 groups.push($children); 1587 1588 return groups; 1589 }; 1590 1591 /* åè¦ç´ ã®é«ããæãã */ 1592 var equalHeight = function(elm){ 1593 var maxHeight = 0; 1594 elm.css("height", "auto"); 1595 1596 // ã¹ãã¼ãããã¤ã¹ã®æã¯é«ããautoã«è¨å® 1597 if((u.isNotPC()) && (elm.parents(".equalHeight").hasClass(cancelName))){ 1598 maxHeight = "auto"; 1599 } else { 1600 elm.each(function(){ 1601 if($(this).height() > maxHeight){ 1602 maxHeight = $(this).height(); 1603 } 1604 });
1605 } 1606 1607 return elm.height(maxHeight); 1608 }; 1609 1610 /* init */ 1611 var init = function(){ 1612 var groups = grouping(), 1613 h = [], 1614 child = [], 1615 maxHeight = 0, 1616 top = 0; 1617 1618 $.each(groups, function(){ 1619 var $group = $(this); 1620 $group.each(function(i){ 1621 $(this).css("height", "auto"); 1622 h[i] = $(this).height(); 1623 1624 if ((top !== Math.floor($(this).offset().top))) { 1625 equalHeight($(child)); 1626 child = []; 1627 top = Math.floor($(this).offset().top); 1628 } 1629 child.push(this); 1630 }); 1631 }); 1632 if(child.length > 1){ equalHeight($(child)); } 1633 }; 1634 1635 /* init 1636 ------------------------------- */ 1637 // æåå¯å¤ã»ãªãµã¤ãºã¸ã®å¯¾å¿å¯å¦ 1638 fsCheck ? u.isFontSizeCheck(init) : init(); 1639 wsCheck ? u.isWindowSizeCheck(init) : init(); 1640 }, 1641 /* 1642 * @method headerControl 1643 * - ãããã¼ã¡ãã¥ã¼å¶å¾¡ 1644 */ 1645 headerControl: function(config){ 1646 if(u.isRangeSP()){ return false; } 1647 // options 1648 var c = $.extend({ 1649 factorElement: '.js-header', 1650 headerUtilityElement: '.js-headerUtility', 1651 searchBtnElement: '.js-headerSearchBtn', 1652 gNavElement: '.js-gNav', 1653 searchElement: '.js-headerSearch', 1654 menuInnerElement: '.js-menuInner', 1655 closeBtnElement: '.js-manuClose' 1656 }, config); 1657 // vars 1658 var $elm = $(c.factorElement), 1659 $headerUtility = $(c.headerUtilityElement), 1660 $searchBtn = $(c.searchBtnElement), 1661 $gNav = $(c.gNavElement), 1662 gNavTrigger = $gNav.children('ul').children('li'), 1663 $search = $(c.searchElement), 1664 menuInner = c.menuInnerElement, 1665 $closeBtn = $(c.closeBtnElement), 1666 pagePathName = u.pagePath.split('/'), 1667 matchFlag = false, 1668 openClassName = 'open', 1669 currentClassName = 'current', 1670 fixedClassName = 'is-fixed', 1671 speed = 300, 1672 scrollpos, 1673 scrollTop = 0, 1674 menuExtraObject,gNavExtraObject,winH,menuH,menuPanelH,gNavH,gNavPanelH; 1675 // exit 1676 if($elm.length === 0){ return false; } 1677 /* setting 1678 ================================ */ 1679 // 追å¾ãããã¼ç¨ 1680 var headerH = $elm.innerHeight(); 1681 u.$win.on("scroll", function(){ 1682 if(u.$win.scrollTop() > headerH){ 1683 if(!$elm.hasClass(fixedClassName)){ 1684 $elm.addClass(fixedClassName).next().css({'paddingTop': headerH + 'px'}); 1685 $elm.css('top', headerH * -1).animate({'top': 0}, 500); 1686 } 1687 } else { 1688 $elm.removeClass(fixedClassName).next().css({'paddingTop': 0}); 1689 $headerUtility.after($gNav); 1690 } 1691 1692 if($elm.hasClass(fixedClassName)) { 1693 const left = u.$win.scrollLeft(); 1694 $elm.css('left', -left); 1695 } 1696 }); 1697 1698 // extraObject 1699 if($elm.hasClass(fixedClassName)){ 1700 menuExtraObject = 60; 1701 gNavExtraObject = 68; 1702 } else { 1703 menuExtraObject = 80; 1704 gNavExtraObject = 127; 1705 } 1706 1707 // ONä½è£ 1708 var pageStage2 = pagePathName[2]; 1709 $(gNavTrigger).each(function(){ 1710 if(pagePathName[2] === $(this).attr('data-directory')){ 1711 $(this).addClass(currentClassName); 1712 } 1713 }); 1714 /* function 1715 ================================ */ 1716 // ariaControl 1717 function ariaControl(_trigger, _target, _boolean) { 1718 const expandedAttr = 'aria-expanded'; 1719 const targetHiddensAttr = 'aria-hidden'; 1720 if (_boolean) { 1721 _trigger.attr(expandedAttr, 'true'); 1722 _target.attr(targetHiddensAttr, 'false'); 1723 } else { 1724 _trigger.attr(expandedAttr, 'false'); 1725 _target.attr(targetHiddensAttr, 'true'); 1726 } 1727 } 1728 // closeSearch 1729 function closeSearch(){ 1730 $searchBtn.removeClass(openClassName); 1731 $searchBtn.find('span').text('SEARCH'); 1732 $search.fadeOut(speed); 1733 ariaControl($searchBtn, $search, false); 1734 } 1735 1736 // closeGnavMenu 1737 function closeGnavMenu(){ 1738 $(gNavTrigger).removeClass(openClassName); 1739 $(gNavTrigger).find(menuInner).fadeOut(speed); 1740 ariaControl($(gNavTrigger), $(gNavTrigger).find(menuInner), false); 1741 } 1742 1743 // IRãã¥ã¼ã¹ ã¹ã¯ãã¼ã«ãã¼ 1744 $(gNavTrigger).find(".menuInner .newsArea").mCustomScrollbar({ 1745 theme:"minimal-dark", 1746 scrollInertia: 300 1747 }); 1748 1749 /* trigger 1750 ================================ */ 1751 // searchOpen 1752 $searchBtn.on("click",function(){ 1753 if($searchBtn.hasClass(openClassName)){ 1754 closeSearch(); 1755 } else { 1756 closeGnavMenu(); 1757 $search.not(':animated').fadeIn(speed,function(){ 1758 $searchBtn.addClass(openClassName); 1759 $searchBtn.find('span').text('CLOSE'); 1760 $search.find('#bizsearchAspQuery').focus(); 1761 });
1762 ariaControl($searchBtn, $search, true); 1763 } 1764 }); 1765 1766 // openGnavMenu 1767 $(gNavTrigger).on("click",function(){ 1768 const $currentGnav = $(this); 1769 if($currentGnav.hasClass(openClassName)){ 1770 closeGnavMenu(); 1771 } else { 1772 closeSearch(); 1773 closeGnavMenu(); 1774 $currentGnav.find(menuInner).not(':animated').fadeIn(speed,function(){ 1775 $currentGnav.addClass(openClassName); 1776 }); 1777 ariaControl($currentGnav, $currentGnav.find(menuInner), true); 1778 winH = u.$win.innerHeight(); 1779 if($elm.hasClass(fixedClassName)){ 1780 gNavH = $(this).find(menuInner).innerHeight() + parseInt(gNavExtraObject); 1781 } else { 1782 gNavH = $(this).find(menuInner).innerHeight() + parseInt(gNavExtraObject); 1783 } 1784 if(gNavH >= winH){ 1785 if($elm.hasClass(fixedClassName)){ 1786 gNavPanelH = parseInt(winH) - parseInt(gNavExtraObject); 1787 } else { 1788 gNavPanelH = parseInt(winH) - parseInt(gNavExtraObject); 1789 } 1790 $(this).find(menuInner).find('.menuBoxInner').css({ 1791 'maxHeight': gNavPanelH + 'px', 1792 'overflow-y': 'scroll' 1793 }); 1794 } 1795 } 1796 }); 1797 1798 $(gNavTrigger).find(menuInner).on("click",function(e){ 1799 e.stopPropagation(); 1800 }); 1801 1802 // closeãã¿ã³å¦ç 1803 $closeBtn.on("click",function(){ 1804 closeGnavMenu(); 1805 }); 1806 1807 // é åå¤ã¯ãªã㯠1808 $(document).on("click",function(){ 1809 closeSearch(); 1810 closeGnavMenu(); 1811 }); 1812 $(c.searchBtnElement+","+c.menuBtnElement+","+c.gNavElement+","+c.searchElement+","+c.menuElement).on("click",function(e){ 1813 e.stopPropagation(); 1814 }); 1815 }, 1816 /* 1817 * @method spheaderControl 1818 * - SPãããã¼ã¡ãã¥ã¼å¶å¾¡ 1819 */ 1820 spheaderControl: function(){ 1821 if(!u.isRangeSP()){ return false; } 1822 var overlayHTML = '<div class="spGrayBg js-spGrayBg"></div>'; 1823 // options 1824 var c = $.extend({ 1825 factorElement: '.js-header', 1826 searchBtnElement: '.js-headerSearchBtn', 1827 menuBtnElement: '.js-headerMenuBtn', 1828 searchElement: '.js-headerSearch', 1829 menuElement: '.js-headerMenu', 1830 spMenuElement: '.js-spMenu', 1831 triggerElement: '.js-spMenuTrigger', 1832 panelElement: '.js-spMenuPanel', 1833 overlayElement: '.js-spGrayBg' 1834 }); 1835 // vars 1836 var $elm = $(c.factorElement), 1837 $searchBtn = $(c.searchBtnElement), 1838 $menuBtn = $(c.menuBtnElement), 1839 $search = $(c.searchElement), 1840 $menu = $(c.menuElement), 1841 spMenuWrap = c.spMenuElement, 1842 spMenuTrigger = c.triggerElement, 1843 spMenuPanel = c.panelElement, 1844 overlay = c.overlayElement, 1845 $overlay = $(overlay), 1846 openClassName = 'open', 1847 fixedClassName = 'is-fixed', 1848 menuOpenClass = 'is-menu_open', 1849 speed = 300, 1850 scrollpos, 1851 scrollTop = 0, 1852 winH,menuH,menuPanelH; 1853 // exit 1854 if($elm.length === 0){ return false; } 1855 /* setting 1856 ================================ */ 1857 // ariaControl 1858 function ariaControl(_trigger, _target, _boolean) { 1859 const expandedAttr = 'aria-expanded'; 1860 const targetHiddensAttr = 'aria-hidden'; 1861 if (_boolean) { 1862 _trigger.attr(expandedAttr, 'true'); 1863 _target.attr(targetHiddensAttr, 'false'); 1864 } else { 1865 _trigger.attr(expandedAttr, 'false'); 1866 _target.attr(targetHiddensAttr, 'true'); 1867 } 1868 } 1869 // closeSearch 1870 function closeSearch(){ 1871 $searchBtn.removeClass(openClassName); 1872 $searchBtn.find('span').text('SEARCH'); 1873 $search.fadeOut(speed); 1874 $elm.next(overlay).remove(); 1875 ariaControl($searchBtn, $search, false); 1876 } 1877 // closeMenu 1878 function closeMenu(){ 1879 $menuBtn.removeClass(openClassName); 1880 $menuBtn.find('span').text('MENU'); 1881 $menu.fadeOut(speed); 1882 $elm.next(overlay).remove(); 1883 ariaControl($menuBtn, $menu, false); 1884 } 1885 // opneScroll 1886 function opneScroll(){ 1887 if(!$('body').hasClass(menuOpenClass)){ 1888 scrollpos = $(window).scrollTop(); 1889 $('body').addClass(menuOpenClass).css({'top': -scrollpos}); 1890 } 1891 } 1892 // closeScroll 1893 function closeScroll(){ 1894 if($('body').hasClass(menuOpenClass)){ 1895 $('body').removeClass(menuOpenClass).css({'top': 0}); 1896 window.scrollTo( 0 , scrollpos ); 1897 } 1898 } 1899 /* function 1900 ================================ */ 1901 // searchOpen 1902 $searchBtn.on("click",function(){ 1903 if($searchBtn.hasClass(openClassName)){ 1904 closeSearch(); 1905 closeScroll(); 1906 } else { 1907 closeMenu(); 1908 opneScroll(); 1909 $search.not(':animated').fadeIn(speed,function(){ 1910 $searchBtn.addClass(openClassName); 1911 $searchBtn.find('span').text('CLOSE'); 1912 $search.find('#bizsearchAspQuery').focus(); 1913 });
1914 ariaControl($searchBtn, $search, true); 1915 $elm.after(overlayHTML); 1916 } 1917 }); 1918 1919 // menuOpen 1920 $menuBtn.on("click",function(){ 1921 closeSearch(); 1922 if($menuBtn.hasClass(openClassName)){ 1923 closeMenu(); 1924 closeScroll(); 1925 } else { 1926 closeSearch(); 1927 opneScroll(); 1928 $menu.not(':animated').fadeIn(speed,function(){ 1929 $menuBtn.addClass(openClassName); 1930 $menuBtn.find('span').text('CLOSE'); 1931 }); 1932 ariaControl($menuBtn, $menu, true); 1933 winH = u.$win.innerHeight(); 1934 menuH = $menu.innerHeight(); 1935 menuPanelH = parseInt(winH) - 51; 1936 $menu.css({ 1937 'maxHeight': menuPanelH + 'px' 1938 }); 1939 $elm.after(overlayHTML); 1940 } 1941 }); 1942 1943 // SPã¡ãã¥ã¼å ã¢ã³ã¼ãã£ãªã³ 1944 $(spMenuTrigger).children('a').on('click',function(e){ 1945 e.preventDefault(); 1946 }); 1947 $(spMenuTrigger).on('click',function(){ 1948 var trigger = $(this), 1949 wrap = trigger.parents(spMenuWrap); 1950 if(wrap.size()){ 1951 if(trigger.hasClass(openClassName)){ 1952 trigger.removeClass(openClassName); 1953 wrap.find(spMenuPanel).stop(true, true).slideUp(speed); 1954 ariaControl(trigger, wrap.find(spMenuPanel), false); 1955 } else { 1956 trigger.addClass(openClassName); 1957 wrap.find(spMenuPanel).stop(true, true).slideDown(speed); 1958 $(spMenuTrigger).not(trigger).removeClass(openClassName); 1959 $(spMenuPanel).not(trigger.next(spMenuPanel)).stop(true, true).slideUp(speed); 1960 ariaControl($(spMenuTrigger).not(trigger), $(spMenuPanel).not(trigger.next(spMenuPanel)), false); 1961 ariaControl(trigger, wrap.find(spMenuPanel), true); 1962 } 1963 } 1964 }); 1965 1966 // ãªã¼ãã¼ã¬ã¤ 1967 $overlay.on("click",function(){ 1968 closeMenu(); 1969 closeSearch(); 1970 closeScroll(); 1971 }); 1972 1973 // é åå¤ã¯ãªã㯠1974 $(document).on("click",function(){ 1975 closeMenu(); 1976 closeSearch(); 1977 closeScroll(); 1978 }); 1979 $(c.searchBtnElement+","+c.menuBtnElement+","+c.searchElement+","+c.menuElement).on("click",function(e){ 1980 e.stopPropagation(); 1981 }); 1982 }, 1983 /* 1984 * @method sideNavControl 1985 * - å³ããå¶å¾¡ 1986 */ 1987 sideNavControl: function(config){ 1988 // options 1989 var c = $.extend({ 1990 factorElement: '.js-sideMenu', 1991 navStage3Element: '.js-sideNav_stage3', 1992 navStage4Element: '.js-sideNav_stage4' 1993 }, config); 1994 // vars 1995 var $elm = $(c.factorElement), 1996 $stage3 = $elm.find(c.navStage3Element), 1997 $stage4 = $elm.find(c.navStage4Element), 1998 pagePathName = u.pagePath, 1999 pageDirectoryName = pagePathName.substring(0, pagePathName.lastIndexOf('/')) + '/', 2000 pageName, 2001 currentName = 'selected', 2002 matchFlag = false; 2003 // exit 2004 if($elm.length === 0){ return false; } 2005 // setting 2006 $stage4.hide(); 2007 if($('body').hasClass('kodawari')){ 2008 pageName = pageDirectoryName; 2009 } else { 2010 pageName = pagePathName; 2011 } 2012 // funtionï¼ç¬¬4ã¹ãã¼ã¸ã¡ãã¥ã¼ONã»ééå¶å¾¡ 2013 var stage4Matching = function(){ 2014 $('> li', $stage4).each(function(){ 2015 if($(this).find('> a').length){ 2016 var $this4 = $(this), 2017 thisHref = $this4.find('> a').attr('href').split('?')[0].replace('index.html', ''); 2018 if(thisHref === pageName){ 2019 $this4.addClass(currentName); 2020 $this4.find('> ul').show(); 2021 $this4.parent().show(); 2022 $this4.parent().parent().addClass(currentName); 2023 matchFlag = true; 2024 } 2025 } 2026 }); 2027 }; 2028 // funtionï¼ç¬¬3ã¹ãã¼ã¸ã¡ãã¥ã¼ONã»ééå¶å¾¡ 2029 var stage3Matching = function(){ 2030 $('> li', $stage3).each(function(){ 2031 var navStage3Data = $(this).find('> a').attr('data-directory'); 2032 if($(this).find('> a').length){ 2033 var $this3 = $(this), 2034 thisHref = $this3.find('> a').attr('href').split('?')[0].replace('index.html', '');
2035 if(thisHref === pageName || $('body').hasClass(navStage3Data)){ 2036 $this3.addClass(currentName); 2037 $this3.find('> ul').show(); 2038 matchFlag = true; 2039 } 2040 } 2041 }); 2042 }; 2043 // control 2044 if($stage4.size()){ 2045 stage4Matching(); 2046 if(!matchFlag){ 2047 stage3Matching(); 2048 } 2049 } else if($stage3.size()){ 2050 stage3Matching(); 2051 } 2052 } 2053 } 2054}(); 2055 2056 2057 2058/* ------------------------------------------- 2059 * @init 2060------------------------------------------- */ 2061$(function(){ 2062 u = new HASEKO.Util(); 2063 2064 HASEKO.module.initialize(); 2065 2066 /* ãã¼ãæ */ 2067 u.$win.on("load", function(){ 2068 HASEKO.module.equalWidth(true, true); 2069 HASEKO.module.equalHeight(true, true); 2070 }); 2071}); 2072 2073 2074
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.