1/********************************************* 2 * common.js 3 * ------------------------------------------- 4 * @namespace 5 * - OKASAN 6 * @constructor 7 * - Util(variable/method) 8 * :variable 9 * - $win 10 * - $doc 11 * - ua 12 * - SMART_UA 13 * - pagePath 14 * - pageW 15 * - breakPoint1 16 * - breakPoint2 17 * - responsive 18 * :method 19 * - isRangeSP 20 * - isRangeTL 21 * - isRangePC 22 * - isNotPC 23 * - isSmartphone 24 * - isTablet 25 * - isTouch 26 * - isIE 27 * - isIE8 28 * - isIE9 29 * - isIE10 30 * - isIE11 31 * - isStorage 32 * - isShutto 33 * - isFontSizeCheck 34 * - isWindowSizeCheck 35 * @module 36 * - respondDevice 37 * - respondBrowser 38 * - smartView 39 * - rollover 40 * - smoothScroll 41 * - sizeFix 42 * - frameImg 43 * - swapImg 44 * - popup 45 * - printSet 46 * - accordion 47 * - tabSwitcher 48 * - equalWidth 49 * - equalHeight 50 * - linkExpand 51 * - bookmark 52 * - spMenuControl 53 * - spMenuSearchControl 54 * - pcGNavControl 55 * - pcLNavControl 56 * - checkAll 57 * @init 58 * @requires 59 * - jquery.js 60 * - jquery.plugin.js 61*********************************************/ 62 63/* ------------------------------------------- 64 * @namespace 65------------------------------------------- */ 66var OKASAN = OKASAN || {}; 67 68 69 70/* ------------------------------------------- 71 * @constructor 72------------------------------------------- */ 73OKASAN.Util = function(){ 74 this.$win = $(window); 75 this.$doc = $(document); 76 this.ua = navigator.userAgent.toLowerCase(); 77 this.SMART_UA = ['iphone','ipad','android','windows phone']; 78 this.pagePath = location.pathname.replace('index.html', ''); 79 this.pageW = 980; 80 this.breakPoint1 = 640; 81 this.breakPoint2 = 980; 82 this.responsive = false; 83}; 84 85OKASAN.Util.prototype = { 86 /* 87 * @method isRangeSP 88 * @return {Boolean} 89 */ 90 isRangeSP: function(){ 91 var winW = this.$win.width(), 92 innerW = this.$win.innerWidth() ? this.$win.innerWidth() : this.$win.width(), 93 outerW = this.$win.outerWidth(); 94 //return (winW <= this.breakPoint1) ? true : false; 95 return (innerW <= this.breakPoint1 && outerW <= this.breakPoint1) ? true : false; 96 }, 97 98 /* 99 * @method isRangeTL 100 * @return {Boolean} 101 */ 102 isRangeTL: function(){ 103 var winW = this.$win.width(), 104 innerW = this.$win.innerWidth() ? this.$win.innerWidth() : this.$win.width(), 105 outerW = this.$win.outerWidth(); 106 //return ((this.breakPoint1 < winW) && (winW <= this.breakPoint2)) ? true : false; 107 return ((this.breakPoint1 < innerW && this.breakPoint1 < outerW) && (innerW <= this.breakPoint2 && outerW <= this.breakPoint2)) ? true : false; 108 }, 109 110 /* 111 * @method isRangePC 112 * @return {Boolean} 113 */ 114 isRangePC: function(){ 115 var winW = this.$win.width(), 116 innerW = window.innerWidth ? window.innerWidth: this.$win.width(), 117 outerW = window.outerWidth; 118 //return (this.breakPoint2 < winW) ? true : false; 119 return (this.breakPoint2 < innerW && this.breakPoint2 < outerW) ? true : false; 120 }, 121 122 /* 123 * @method isNotPC 124 * @return {Boolean} 125 */ 126 isNotPC: function(){ 127 var uaArray = new RegExp(this.SMART_UA.join("|"),"i"); 128 return uaArray.test(this.ua); 129 }, 130 131 /* 132 * @method isSmartphone 133 * @return {Boolean} 134 */ 135 isSmartphone: function(){ 136 var UA = { 137 iPhone: this.ua.indexOf('iphone') != -1, 138 iPod: this.ua.indexOf('ipod') != -1, 139 Android: this.ua.indexOf('android') != -1 && this.ua.indexOf('mobile') != -1, 140 WindowsPhone: this.ua.indexOf('windows phone') != -1 141 } 142 return (UA.iPhone || UA.iPod || UA.Android || UA.WindowsPhone) ? true : false; 143 }, 144 145 /* 146 * @method isTablet 147 * @return {Boolean} 148 */ 149 isTablet: function(){ 150 var UA = { 151 iPad: this.ua.indexOf('ipad') != -1, 152 Android: this.ua.indexOf('android') != -1 && this.ua.indexOf('mobile') == -1 153 } 154 return (UA.iPad || UA.Android) ? true : false; 155 }, 156 157 /* 158 * @method isTouch 159 * @return {Boolean} 160 */ 161 isTouch: function(){ 162 return ('ontouchstart' in window) ? true : false; 163 }, 164 165 /* 166 * @method isIE 167 * @return {Boolean} 168 */ 169 isIE: function(){ 170 return (this.ua.indexOf("msie") != -1 || this.ua.indexOf("trident") != -1) ? true : false; 171 }, 172 /* 173 * @method isIE8 174 * @return {Boolean} 175 */ 176 isIE8: function(){ 177 return (this.ua.indexOf("msie 8") != -1) ? true : false; 178 }, 179 180 /* 181 * @method isIE9 182 * @return {Boolean} 183 */ 184 isIE9: function(){ 185 return (this.ua.indexOf("msie 9") != -1) ? true : false;
186 }, 187 188 /* 189 * @method isIE10 190 * @return {Boolean} 191 */ 192 isIE10: function(){ 193 return (this.ua.indexOf("msie 10") != -1) ? true : false; 194 }, 195 196 /* 197 * @method isIE11 198 * @return {Boolean} 199 */ 200 isIE11: function(){ 201 return ((this.ua.indexOf("rv 11") != -1 || this.ua.indexOf("rv:11") != -1) && (this.ua.indexOf("trident") != -1)) ? true : false; 202 }, 203 204 /* 205 * @method isStorage 206 * @return {Boolean} 207 */ 208 isStorage: function(){ 209 return window.localStorage ? (function(){ 210 try { 211 localStorage.setItem('check_key', 1); 212 var check_value = localStorage.getItem('check_key'); 213 localStorage.removeItem('check_key'); 214 return (check_value == 1); 215 } catch(e) { 216 return false; 217 } 218 })() : false 219 }, 220 221 /* 222 * @method isShutto 223 * @return {Boolean} 224 */ 225 isShutto: function(){ 226 return ($("body").hasClass("shutto")) ? true : false; 227 }, 228 229 /* 230 * @method isFontSizeCheck 231 * @param {function} callback 232 * - ãã©ã³ããµã¤ãºã夿´ãããããcallbackãå®è¡ 233 */ 234 isFontSizeCheck: function(callback){ 235 var $elm, 236 HTML_FS_WATCHER = $('<div id="fontSizeWatcher"> </div>'), 237 watcherCssObj = { 238 position: "absolute", 239 top: "0", 240 display: "block", 241 padding: "0", 242 visibility: "hidden" 243 }, 244 currentSize = 0, 245 interval = 500; 246 247 // ç£è¦ç¨HTMLãçæãã 248 HTML_FS_WATCHER.css(watcherCssObj).appendTo("body"); 249 $elm = $("#fontSizeWatcher"); 250 251 // è¦ç´ ã®é«ããåå¾ 252 var getSize = function($elm){ return $elm.height(); }; 253 254 // è¦ç´ ã®é«ããæ¯è¼ãã¦ãç°ãªãã°callbackãå®è¡ 255 var fontSizeCheck = function(){ 256 var h = getSize($elm); 257 258 if(h === currentSize){ 259 return false; 260 } else { 261 currentSize = h; 262 callback(); 263 } 264 }; 265 setInterval(fontSizeCheck, interval); 266 }, 267 268 /* 269 * @method isWindowSizeCheck 270 * @param {function} callback 271 * - windowã®ãªãµã¤ãºå¦çãå®äºããããcallbackãå®è¡ 272 */ 273 isWindowSizeCheck: function(callback){ 274 var resize = false, 275 interval = 500; 276 277 this.$win.on("resize", function(){ 278 // ãªãµã¤ãºããã¦ããéã¯ä½ãããªã 279 if(resize !== false){ clearTimeout(resize); } 280 281 resize = setTimeout(function(){ 282 callback(); 283 }, interval); 284 }); 285 } 286 287}; 288 289 290 291/* ------------------------------------------- 292 * @module 293------------------------------------------- */ 294OKASAN.module = function(){ 295 var u = new OKASAN.Util(); 296 297 return { 298 /* 299 * @method initialize 300 * - åæå 301 */ 302 initialize: function(){ 303 this.respondDevice(); 304 this.respondBrowser(); 305 this.smartView(); 306 this.rollover(); 307 this.smoothScroll(); 308 this.frameImg(); 309 this.swapImg(); 310 this.popup(); 311 this.printSet(); 312 this.accordion({ 313 targetWrap: ".boxFaq01.accordion, .boxFaq02.accordion", 314 toggleFrameClass: ".frame01", 315 toggleBtnClass: ".que01", 316 togglePanelClass: ".ans01", 317 slideSpeed : 400 318 }); 319 this.accordion({ 320 targetWrap: ".accordionFrame01", 321 toggleFrameClass: ".accordionItem", 322 toggleBtnClass: ".accordionLabel", 323 togglePanelClass: ".accordionBody", 324 slideSpeed : 400 325 }); 326 this.accordion({ 327 targetWrap: ".boxAcc01", 328 toggleFrameClass: ".frame01", 329 toggleBtnClass: ".hdg01", 330 togglePanelClass: ".detail01", 331 slideSpeed : 400 332 }); 333 this.accordion({ 334 spOnly: true, 335 targetWrap: ".toggleColumn", 336 toggleFrameClass: ".colL01:not(.multiCol)", 337 toggleBtnClass: ".colL01:not(.multiCol) .hdgLink", 338 togglePanelClass: ".colL01:not(.multiCol) .colInner", 339 slideSpeed : 400 340 }); 341 this.accordion({ 342 spOnly: true, 343 toggleFrameClass: ".spToggleBox", 344 toggleBtnClass: ".hdg, .hdg02", 345 togglePanelClass: ".spToggleBox .hdg + .inner01, .spToggleBox .hdg02 + .inner01", 346 slideSpeed : 400 347 }); 348 this.accordion({ 349 spOnly: true, 350 targetWrap: ".toggleColumn", 351 toggleFrameClass: ".videoLayout", 352 toggleBtnClass: ".linkListBtn01", 353 togglePanelClass: ".column", 354 slideSpeed : 400 355 }); 356 this.accordion(); 357 this.tabSwitcher({ 358 containerName: ".boxTab01", 359 naviClass: ".nav01", 360 panelClass: ".frame01", 361 currentName: "on" 362 }); 363 this.tabSwitcher({ 364 containerName: ".fundTab", 365 naviClass: ".fundTabNavList", 366 panelClass: ".fundTabPanel", 367 currentName: "selected" 368 }); 369 this.tabSwitcher(); 370 this.linkExpand({ 371 targetBoxClass: ".boxFrame01, .boxPlungin01, .boxNews01 > .frame01" 372 }); 373 this.linkExpand(); 374 this.spMenuControl(); 375 this.spMenuSearchControl(); 376 this.pcGNavControl(); 377 this.pcLNavControl(); 378// this.footNavControl(); 379 this.bookmark(); 380 this.accountForm(); 381 this.tableAccordion(); 382 this.addTelLink(); 383 this.checkAll(); 384 this.fundSearch(); 385 this.directCheck(); 386 }, 387 388 /* 389 * @method respondDevice 390 * - ããã¤ã¹å¯¾å¿ 391 */ 392 respondDevice: function(){ 393 /* ã¹ãã以å¤ã®å ´å */ 394 if(!u.isSmartphone()){ 395 // é»è©±çªå·ã®ãªã³ã¯åé¤ 396 $('a[href^="tel:"]').each(function(){ 397 $(this).find("> *").unwrap(); 398 }); 399 } 400 }, 401 402 /* 403 * @method respondBrowser 404 * - ãã©ã¦ã¶å¯¾å¿ 405 */ 406 respondBrowser: function(){
407 /* IE8ã®å ´å */ 408 if(u.isIE8()){ 409 // ééPNGå¯¾å¿ 410 $('img[src$="png"]').each(function(){ 411 $(this).css({ 412 "background": "transparent", 413 "filter": 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + $(this).attr("src") + '", sizingMethod="scale");' 414 }); 415 }); 416 } 417 /* IE8/IE9ã®å ´å */ 418 if(u.isIE8() || u.isIE9()){ 419 // cssPIEå¯¾å¿ 420 u.$win.on("load", function(){ 421 if(window.PIE){ 422 $(".pie").css({ 423 "position": "relative", 424 "zoom": 1 425 }).each(function(){ 426 PIE.attach(this); 427 }); 428 } 429 }); 430 } 431 }, 432 433 /* 434 * @method smartView 435 * - viewportå¯¾å¿ 436 */ 437 smartView: function(){ 438 var viewPoint = u.pageW, 439 excludeDir = u.pagePath.split("/"); 440 441 //if(u.isTablet() && excludeDir[1]!=""){ 442 if(u.isTablet()){ 443 $("html").addClass("is-tablet"); 444 $("body").css("width", viewPoint + "px"); 445 $("meta[name='viewport']").attr("content", "width=" + viewPoint); 446 } else if(u.isSmartphone()){ 447 //if(!u.isShutto()){ 448 // $("body").css("width", viewPoint + "px"); 449 //} 450 //$("meta[name='viewport']").attr("content", "width=device-width, initial-scale=1, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"); 451 } 452 }, 453 454 /* 455 * @method rollover 456 * - ãã¼ã«ãªã¼ãã¼ 457 */ 458 rollover: function(){ 459 /* vars 460 ------------------------------- */ 461 var $elm = $(".rollover"), 462 onSuffix = "on"; 463 464 if($elm.length === 0 || u.isNotPC()){ 465 return false; 466 } 467 468 /* function 469 ------------------------------- */ 470 var src = { 471 over: function($elm){return $elm.attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1" + onSuffix + "$2");}, 472 out: function($elm){return $elm.attr("src").replace(new RegExp("^(.+)" + onSuffix + "(\.[a-z]+)$" ), "$1$2");}, 473 preload: function($elm){return $elm.attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1" + onSuffix + "$2");} 474 }; 475 476 /* trigger 477 ------------------------------- */ 478 $elm 479 .hover(function(){ 480 $(this).attr("src", src.over($(this))); 481 }, function(){ 482 $(this).attr("src", src.out($(this))); 483 }) 484 .each(function(){ 485 $("<img>").attr("src", src.preload($(this))); 486 }); 487 }, 488 489 /* 490 * @method smoothScroll 491 * - ã¹ã ã¼ã¹ã¹ã¯ãã¼ã« 492 */ 493 smoothScroll: function(){ 494 /* vars 495 ------------------------------- */ 496 var noScrollClass = ".noScroll", 497 pagetop = "#page", 498 fixedHeader = "#header", 499 fixedHeaderHeight = u.isRangeSP() ? $(fixedHeader).outerHeight() : 0, 500 href, 501 anc,
502 position, 503 speed = 300, 504 easing = "swing"; 505 506 /* ãã¼ã¸å ã¹ã¯ãã¼ã« */ 507 $("a[href*='#']") 508 .not("a[href='#'], a[href^='#tab'], a[href^='#cb_inline'], a[href^='#top'], " + noScrollClass) 509 .on("click", function (e) { 510 if (this.pathname !== window.location.pathname && this.pathname !== "") return; 511 512 href = this.hash; 513 anc = $(href); 514 if (!anc.length) return; 515 e.preventDefault(); 516 position = anc.offset().top; 517 scrolling(); 518 }); 519 520 /* ãã¼ã¸ããã */ 521 $("a[href*='#top']").on("click", function(e){ 522 e.preventDefault(); 523 position = 0; 524 scrolling(); 525 }); 526 527 528 function scrolling(){ 529 $('body,html').animate({ 530 scrollTop: position - fixedHeaderHeight 531 }, speed, easing); 532 } 533 }, 534 535 /* 536 * @method sizeFix 537 * - å¹ åºå® 538 */ 539 sizeFix: function(){ 540 /* vars 541 ------------------------------- */ 542 var elm = ".sizeFix", 543 baseName = "baseSize", 544 captionName = "figcaption", 545 setW; 546 547 if($(elm).length == 0){ 548 return false; 549 } 550 551 552 $(elm).each(function(){ 553 554 var self = $(this); 555 556 if(self.is(':visible')){ 557 558 if(self.find("img").hasClass(baseName)){ 559 setW = $("." + c.baseName, self).width(); 560 } else { 561 setW = $("img", self).width(); 562 } 563 if(setW > self.width()){ 564 setW = self.width(); 565 } 566 self.css("width", setW); 567 568 } 569 570 }) 571 }, 572 573 /* 574 * @method frameImg 575 * - ç»åæ è¨å® 576 */ 577 frameImg: function(){ 578 /* vars 579 ------------------------------- */ 580 var $elm = $(".imgFrame"); 581 582 if($elm.length == 0){ 583 return false; 584 } 585 586 $elm.each(function(){ 587 var self = $(this), 588 type = self.attr("class").replace('imgFrame ', ''); 589 590 self.removeClass(type).wrap('<span class="imgWrap ' + type + '"></span>'); 591 }); 592 }, 593 594 /* 595 * @method swapImg 596 * - ã¦ã£ã³ãã¦å¹ ã§ç»ååãæ¿ã 597 */ 598 swapImg: function(){ 599 /* vars 600 ------------------------------- */ 601 var $elm = $(".swap"), 602 pcPrefixName = "pc_", 603 spPrefixName = "sp_"; 604 605 if($elm.length == 0){ 606 return false; 607 } 608 609 /* function 610 ------------------------------- */ 611 var swap = function(img){ 612 if(u.isRangeSP()){ 613 img.attr("src", img.attr("src").replace(pcPrefixName, spPrefixName)); 614 } else { 615 img.attr("src", img.attr("src").replace(spPrefixName, pcPrefixName)); 616 } 617 }; 618 619 /* trigger 620 ------------------------------- */ 621 $elm.each(function(){ 622 var self = $(this); 623 624 // ãã¼ãæ 625 u.$win.on("load", function(){ 626 swap(self); 627 }); 628 // ãªãµã¤ãºæ 629 u.$win.on("orientationchange resize", function(){ 630 swap(self); 631 }); 632 }); 633 }, 634 635 /* 636 * @method popup 637 * - ãããã¢ãã 638 */ 639 popup: function(config){ 640 /* options 641 ------------------------------- */ 642 var c = $.extend({ 643 targetElm: ".popup", 644 popW: 600, 645 popH: 600 646 }, config); 647 648 /* vars 649 ------------------------------- */ 650 var $elm = $(c.targetElm); 651 652 if($elm.length === 0){ 653 return false; 654 } 655 656 /* trigger 657 ------------------------------- */ 658 $elm.each(function(){ 659 var self = $(this), 660 name = "POPUP", 661 width = c.popW, 662 height = c.popH, 663 menubar = "no", 664 toolbar = "no", 665 location = "yes", 666 status = "yes", 667 scrollbars = "yes", 668 resizable = "yes", 669 left = 0, 670 top = 0, 671 parameters, 672 center = false; 673 674 // ãããã¢ããã天å°å·¦å³ä¸å¤®ã«é ç½®ããå ´å 675 if(center){ 676 top = (screen.height - height) / 2; 677 left = (screen.width - width) / 2; 678 } 679 680 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; 681 682 self.on("click", function(){ 683 window.open(self.href, name, parameters); 684 return false; 685 }) 686 }); 687 }, 688 689 /* 690 * @method printSet 691 * - å°å·ãã¤ã¢ãã° 692 */ 693 printSet: function(config){ 694 /* options 695 ------------------------------- */ 696 var c = $.extend({ 697 targetElm: ".printLink", 698 noPrintName: "noPrint" 699 }, config); 700 701 /* vars 702 ------------------------------- */ 703 var $elm = $(c.targetElm); 704 705 if($elm.length === 0){ 706 return false;
707 } 708 709 /* trigger 710 ------------------------------- */ 711 $elm.each(function(){ 712 var self = $(this); 713 714 if($("body").hasClass(c.noPrintName)){ 715 self.hide(); 716 return false; 717 } else { 718 self.on("click", function(){ 719 window.print(); 720 return false; 721 }); 722 } 723 }); 724 }, 725 726 /* 727 * @method accordion 728 * - ã¢ã³ã¼ãã£ãªã³ 729 */ 730 accordion: function(config){ 731 /* options 732 ------------------------------- */ 733 var c = $.extend({ 734 spOnly: false, 735 targetWrap: ".toggleWrap01", 736 dispType: "allHide", // åæè¡¨ç¤ºè¨å®ï¼ãallHideãorãallShowãorãselectã 737 firstDisplay: 0, // åæè¡¨ç¤ºå¯¾è±¡ 738 toggleFrameClass: ".toggleFrame01", 739 toggleBtnClass: ".toggleBtn", // ééãã¿ã³ 740 togglePanelClass: ".togglePanel", // ééããã« 741 switchClassName: "active", // åãæ¿ãã¯ã©ã¹ 742 closeBtnClass: ".closeBtn", // ãéããããã¿ã³ 743 slideSpeed : 200 // ã¹ã©ã¤ãã¹ãã¼ã 744 }, config); 745 746 /* vars 747 ------------------------------- */ 748 var $elm = $(c.targetWrap), 749 targetFrame, 750 targetBtn, 751 targetPanel; 752 753 if($elm.length == 0 || (c.spOnly && u.isRangeTL()) || (c.spOnly && u.isRangePC())){ 754 return false; 755 } 756 757 /* settings 758 ------------------------------- */ 759 /* ééãã¿ã³ï¼ã¯ãªãã¯ã¨ãªã¢ï¼ã¨ééããã«ã®ä½ç½®é¢ä¿ãå å¼é¢ä¿ãã©ãã */ 760 $elm.each(function(){ 761 762 var $this = $(this), 763 toggleFrameClass = $(c.toggleFrameClass, $this), 764 toggleBtn = $(c.toggleBtnClass, $this), 765 togglePanel = $(c.togglePanelClass, $this); 766 767 if(c.targetWrap === ".toggleColumn"){ 768 toggleBtn.append('<span class="icTrigger"></span>'); 769 toggleBtn = $(".icTrigger", $this); 770 } 771 772 function toggleSettings(){ 773 /* åæè¡¨ç¤ºè¨å® */ 774 switch(c.dispType) { 775 // å ¨é表示ã®å ´å 776 case "allHide": 777 togglePanel.hide(); 778 break; 779 // å ¨è¡¨ç¤ºã®å ´å 780 case "allShow": 781 toggleFrameClass.addClass(c.switchClassName); 782 break; 783 // 1ã¤ã ã表示ããå ´å 784 case "select": 785 togglePanel.hide(); 786 toggleFrameClass.eq(c.firstDisplay).addClass(c.switchClassName).find(c.togglePanelClass).show(); 787 break; 788 default: 789 break; 790 } 791 } 792 793 if(toggleFrameClass.hasClass("videoLayout")){ 794 u.$win.load(function(){toggleSettings();}); 795 } else { 796 toggleSettings(); 797 } 798 799 /* trigger 800 ------------------------------- */ 801 toggleBtn.on('click', function(){ 802 var $this = $(this); 803 $this.closest(c.toggleFrameClass).toggleClass(c.switchClassName); 804 if($this.hasClass("icTrigger")){ 805 $this.closest(c.toggleBtnClass).next().stop(true, true).slideToggle(c.slideSpeed); 806 } else { 807 $this.next().stop(true, true).slideToggle(c.slideSpeed); 808 } 809 // é«ãæãå®è¡ 810 OKASAN.module.equalHeight(); 811 OKASAN.module.sizeFix(); 812 return false; 813 }); 814 815 /* ãéããããã¿ã³å¶å¾¡ */ 816 $(c.closeBtnClass).on("click", "a", function(){ 817 targetPanel = $(this).parents(c.togglePanelClass); 818 targetFrame = targetPanel.closest(c.toggleFrameClass); 819 820 targetPanel.stop(true, true).slideUp(c.slideSpeed); 821 targetFrame.removeClass(c.switchClassName); 822 }); 823 824 }); 825 }, 826 827 /* 828 * @method tabSwitcher 829 * - ã¿ãåãæ¿ã 830 */ 831 tabSwitcher: function(config){ 832 /* options 833 ------------------------------- */ 834 var c = $.extend({ 835 containerName: ".tabWrap01", 836 noSwitchName: "noSwitch", 837 naviClass: ".tabNavi", 838 panelClass: ".tabPanel", 839 currentName: "on", 840 firstTarget: "" // åæè¡¨ç¤ºå¯¾è±¡ï¼ã¿ãã®idãæå®ï¼â»ä½ãæå®ããªããã°ä¸çªæåã®ã¿ããè¡¨ç¤ºï¼ 841 }, config); 842 843 /* vars 844 ------------------------------- */ 845 var $container = $(c.containerName), 846 tabNavi = $(c.naviClass, $container), 847 tabPanel = $(c.panelClass, $container), 848 firstPanel, 849 targetTab, 850 targetPanel; 851 852 if($container.length == 0){ 853 return false; 854 } 855 856 /* setting 857 ------------------------------- */ 858 /* ã¿ãã®æ°ãclassã¨ãã¦ä»ä¸ */ 859 $container.each(function(){ 860 var tab = $(this), 861 btn = $(".tabNavi.type-head > .tabBtn", tab), 862 num = $("> li", btn).length; 863 $(".tabBtn", tab).addClass("count" + num); 864 }); 865 866 /* trigger 867 ------------------------------- */ 868 $container.not("." + c.noSwitchName).each(function(){ 869 targetTab = $(this); 870 tabNavi = $(c.naviClass, targetTab); 871 tabPanel = $(c.panelClass, targetTab); 872 873 /* åæè¡¨ç¤º */ 874 if(c.firstTarget != ""){ // JSå´ã§åæè¡¨ç¤ºã¿ãã«æå®ãããå ´å 875 firstPanel = c.firstTarget; 876 } else if(tabNavi.find("li").hasClass(c.currentName)){ // HTMLå´ã§ç¾å¨å°ã®æå®ãããå ´å 877 firstPanel = $("." + c.currentName, targetTab).find("a").attr("href"); 878 } else { 879 firstPanel = tabNavi.find("li:first a").attr("href"); 880 } 881 tabNavi.find("a[href = '"+ firstPanel +"']").parent().addClass(c.currentName); 882 tabPanel.show().not(firstPanel).hide(); 883 884 /* ãã¿ããã¿ã³ãã¯ãªãã¯å¶å¾¡ */ 885 tabNavi.on("click", "a", function(){ 886 var self = $(this); 887 888 if(self.parent().hasClass(c.currentName)){ 889 return false;
890 } else { 891 targetPanel = self.attr("href"); 892 targetTab = self.parents(c.containerName); 893 tabNavi = $(c.naviClass, targetTab); 894 tabPanel = $(c.panelClass, targetTab); 895 896 tabNavi.find("li").removeClass(c.currentName); 897 tabNavi.find("a[href = '"+ targetPanel +"']").parent().addClass(c.currentName); 898 tabPanel.show().not(targetPanel).hide(); 899 900 // é«ãæãå®è¡ 901 OKASAN.module.equalHeight(); 902 OKASAN.module.equalWidth(); 903 return false; 904 } 905 }); 906 }); 907 }, 908 909 /* 910 * @method equalWidth 911 * - å¹ æã 912 * @param {Boolean} 913 * - æåå¯å¤ã»ãªãµã¤ãºã«å¯¾å¿ãããã©ãã 914 */ 915 equalWidth: function(fsCheck, wsCheck){ 916 /* vars 917 ------------------------------- */ 918 var $elm = $(".equalWidth"), 919 $children = $elm.children(), 920 childBaseName = "eqChild", 921 fsCheck = fsCheck || false, 922 wsCheck = wsCheck || false; 923 924 if($elm.length === 0 || $children.length < 2){ 925 return false; 926 } 927 928 /* function 929 ------------------------------- */ 930 /* åè¦ç´ ãã¨ã«ã°ã«ã¼ãå */ 931 var grouping = function(){ 932 var $groupedChildren = $elm.find('*[class*=' + childBaseName + ']'), 933 classNames = {},groups = []; 934 935 $groupedChildren.each(function(){ 936 var splitClass = $(this).attr("class").split(" "), 937 splitClassNum = splitClass.length, 938 newClassName; 939 940 for(var i = 0; i < splitClassNum; i++){ 941 newClassName = splitClass[i].match(RegExp(childBaseName + "[a-z0-9]+", 'i')); 942 943 if(!newClassName){ 944 continue; 945 } else { 946 newClassName.toString(); 947 classNames[newClassName] = newClassName; 948 } 949 } 950 }); 951 952 for(var c in classNames){ 953 groups.push($elm.find("." + c)); 954 } 955 groups.push($children); 956 957 return groups; 958 }; 959 960 /* åè¦ç´ ã®å¹ ãæãã */ 961 var equalWidth = function(elm){ 962 var maxWidth = 0; 963 elm.css("width", "auto"); 964 965 elm.each(function(){ 966 if($(this).width() > maxWidth){ 967 maxWidth = $(this).width() + 5; 968 } 969 970 }); 971 return elm.width(maxWidth); 972 }; 973 974 /* init */ 975 var init = function(){ 976 var groups = grouping(), 977 w = [], 978 child = [], 979 maxWidth = 0; 980 981 $.each(groups, function(){ 982 var $group = $(this); 983 984 $group.each(function(i){ 985 $(this).css("width", "auto"); 986 w[i] = $(this).width(); 987 988 child.push(this); 989 }); 990 }); 991 if(child.length > 1){ equalWidth($(child)); } 992 }; 993 994 /* init 995 ------------------------------- */ 996 // æåå¯å¤ã»ãªãµã¤ãºã¸ã®å¯¾å¿å¯å¦ 997 fsCheck ? u.isFontSizeCheck(init) : init(); 998 wsCheck ? u.isWindowSizeCheck(init) : init(); 999 }, 1000 1001 /* 1002 * @method equalHeight 1003 * - é«ãæã 1004 * @param {Boolean} 1005 * - æåå¯å¤ã»ãªãµã¤ãºã«å¯¾å¿ãããã©ãã 1006 */ 1007 equalHeight: function(fsCheck, wsCheck){ 1008 /* vars 1009 ------------------------------- */ 1010 var $elm = $(".equalHeight"), 1011 $children = $elm.children(), 1012 childBaseName = "eqChild", 1013 cancelName = "smart-cancel", 1014 spCancel = "sp-cancel" 1015 fsCheck = fsCheck || false, 1016 wsCheck = wsCheck || false; 1017 1018 if($elm.length === 0 || $children.length < 2){ 1019 return false; 1020 } 1021 1022 /* function 1023 ------------------------------- */ 1024 /* åè¦ç´ ãã¨ã«ã°ã«ã¼ãå */ 1025 var grouping = function(){ 1026 var $groupedChildren = $elm.find('*[class*=' + childBaseName + ']'), 1027 classNames = {},groups = []; 1028 1029 $groupedChildren.each(function(){ 1030 var splitClass = $(this).attr("class").split(" "), 1031 splitClassNum = splitClass.length, 1032 newClassName; 1033 1034 for(var i = 0; i < splitClassNum; i++){ 1035 newClassName = splitClass[i].match(RegExp(childBaseName + "[a-z0-9]+", 'i')); 1036 1037 if(!newClassName){ 1038 continue; 1039 } else { 1040 newClassName.toString(); 1041 classNames[newClassName] = newClassName; 1042 } 1043 } 1044 }); 1045 1046 for(var c in classNames){ 1047 groups.push($elm.find("." + c)); 1048 } 1049 groups.push($children); 1050 1051 return groups; 1052 }; 1053 1054 /* åè¦ç´ ã®é«ããæãã */ 1055 var equalHeight = function(elm){ 1056 var maxHeight = 0; 1057 elm.css("height", "auto"); 1058 1059 // ã¹ãã¼ãããã¤ã¹ã®æã¯é«ããautoã«è¨å® 1060 if(((u.isNotPC()) && (elm.parents(".equalHeight").hasClass(cancelName))) ||(u.isRangeSP()) && (elm.parents(".equalHeight").hasClass(spCancel))){ 1061 maxHeight = "auto"; 1062 } else { 1063 elm.each(function(){ 1064 if($(this).height() > maxHeight){ 1065 maxHeight = $(this).height(); 1066 } 1067 }); 1068 } 1069 1070 return elm.height(maxHeight); 1071 }; 1072 1073 /* init */ 1074 var init = function(){ 1075 var groups = grouping(), 1076 h = [], 1077 child = [], 1078 maxHeight = 0, 1079 top = 0; 1080 1081 $.each(groups, function(){ 1082 var $group = $(this); 1083 $group.each(function(i){ 1084 $(this).css("height", "auto"); 1085 h[i] = $(this).height(); 1086 1087 if(top != $(this).position().top){ 1088 equalHeight($(child)); 1089 child = []; 1090 top = $(this).position().top; 1091 } 1092 child.push(this); 1093 }); 1094 }); 1095 if(child.length > 1){ equalHeight($(child)); } 1096 }; 1097 1098 /* init 1099 ------------------------------- */ 1100 // æåå¯å¤ã»ãªãµã¤ãºã¸ã®å¯¾å¿å¯å¦ 1101 fsCheck ? u.isFontSizeCheck(init) : init(); 1102 wsCheck ? u.isWindowSizeCheck(init) : init(); 1103 }, 1104 1105 /* ------------------------------------------- 1106 * @method linkExpand 1107 * ------------------------------------------- 1108 * @param {String} containerName 1109 * @param {String} addLinkClassName 1110 * ------------------------------------------- 1111 */ 1112 linkExpand: function (config) { 1113 var c = $.extend({ 1114 targetBoxClass: ".expand", // æ¡å¼µå¯¾è±¡ã«ä»ä¸ããã¯ã©ã¹å 1115 targetLinkClass: ".expandLink", // æ¡å¼µããããªã³ã¯ï¼<a>ã¿ã°ï¼ã«ä»ä¸ããã¯ã©ã¹å 1116 targetNoLinkClass: ".noExpandLink", // æ¡å¼µãããããªã対象ã«ä»ä¸ããã¯ã©ã¹å 1117 addBoxClassName: "over" // æ¡å¼µããããªã³ã¯ï¼<a>ã¿ã°ï¼ã«ä»ä¸ããã¯ã©ã¹å 1118 }, config); 1119 1120 if($(c.targetBoxClass).length === 0){ return false; } 1121 1122 $(c.targetBoxClass).not(c.targetNoLinkClass).each(function(){ 1123 1124 if($(this).find("a").length !== 0){ 1125 1126 $(this).css({ cursor: "pointer" }); 1127 1128 /* vars 1129 ------------------------------- */ 1130 var $elm = $(this), 1131 href, // ã¸ã£ã³ãããURL 1132 target; // target屿§ 1133 1134 /* trigger 1135 ------------------------------- */ 1136 $elm.on({ 1137 /* click */ 1138 'click': function() { 1139 1140 var $this = $(this), 1141 $targetLink = $this.find(c.targetLinkClass); 1142 1143 if($targetLink.length !== 0){ 1144 href = $targetLink.attr("href"); 1145 target = $targetLink.attr("target"); 1146 } else { 1147 href = $this.find("a").attr("href"); 1148 target = $this.find("a").attr("target"); 1149 } 1150 1151 if(target){ 1152 window.open(href, target).focus(); 1153 } else { 1154 window.open(href, "_self"); 1155 } 1156 return false;
1157 1158 }, 1159 /* ãã¦ã¹ãªã¼ãã¼ */ 1160 'mouseenter': function() { 1161 $(this).addClass(c.addBoxClassName); 1162 }, 1163 /* ãã¦ã¹ã¢ã¦ã */ 1164 'mouseleave': function() { 1165 $(this).removeClass(c.addBoxClassName); 1166 } 1167 1168 }); 1169 1170 } 1171 1172 1173 }); 1174 1175 }, 1176 1177 /* 1178 * @method spMenuControl 1179 * - SPãã¡ãã¥ã¼ããã¿ã³å¶å¾¡ 1180 */ 1181 spMenuControl: function(){ 1182 /* vars 1183 ------------------------------- */ 1184 var $menu = $("#menu"), 1185 $page = $("#page"), 1186 $btnOpen = $("#headerMenu01 > a"), 1187 $btnClose = $menu.find(".menuBtnClose01 > a, .menuBtnClose02 > a"), 1188 speed = 400; 1189 1190 if($menu.length == 0 && u.isRangeSP()){ 1191 return false; 1192 } 1193 1194 /* trigger 1195 ------------------------------- */ 1196 // éã 1197 $btnOpen.on('click', function(){ 1198 $menu.animate({ 1199 opacity: 'show', 1200 height: 'show', 1201 }); 1202 $page.addClass('is-active'); 1203 $('html').addClass('is-active'); 1204 return false; 1205 }); 1206 1207 // éãã 1208 $btnClose.on('click', function(){ 1209 $menu.animate({ 1210 opacity: 'hide', 1211 height: 'hide', 1212 }, speed, function(){ 1213 OKASAN.module.equalHeight(true, true); 1214 }); 1215 $page.removeClass('is-active'); 1216 $('html').removeClass('is-active'); 1217 return false; 1218 }); 1219 1220 //èªã¿ä¸ãå¶å¾¡ 1221 var windowSize = $(window).width(); 1222 if (windowSize < 641) { 1223 //loadæ 1224 window.onload = function() { 1225 document.querySelectorAll("#search, #search *, #page, #page.is-active *, #fontSizeWatcher").forEach(element => { 1226 element.removeAttribute("aria-hidden"); 1227 element.removeAttribute("tabindex"); 1228 }); 1229 document.querySelectorAll(".aural, .aural *").forEach(element => { 1230 element.setAttribute("aria-hidden", "true"); 1231 element.setAttribute("tabindex", "-1"); 1232 }); 1233 } 1234 // éã 1235 $btnOpen.on('touchstart click', function() { 1236 document.querySelectorAll("#search, #search *, #page, #page.is-active *, #fontSizeWatcher").forEach(element => { 1237 element.setAttribute("aria-hidden", "true"); 1238 element.setAttribute("tabindex", "-1"); 1239 }); 1240 }); 1241 // éãã 1242 $btnClose.on('touchstart click', function() { 1243 document.querySelectorAll("#search, #search *, #page, #page.is-active *, #fontSizeWatcher").forEach(element => { 1244 element.removeAttribute("aria-hidden"); 1245 element.removeAttribute("tabindex"); 1246 }); 1247 }); 1248 } 1249 }, 1250 1251 1252 /* 1253 * @method spMenuSearchControl 1254 * - SPãæ¤ç´¢ããã¿ã³å¶å¾¡ 1255 */ 1256 spMenuSearchControl: function(){ 1257 /* vars 1258 ------------------------------- */ 1259 var $search = $("#search"), 1260 $page2 = $("#page"), 1261 $btnOpen2 = $("#headerMenuSearch01 > a"), 1262 $btnClose2 = $search.find(".menuBtnClose01 > a, .menuBtnClose02 > a"), 1263 speed = 500; 1264 1265 if($search.length == 0 && u.isRangeSP()){ 1266 return false; 1267 } 1268 1269 /* trigger 1270 ------------------------------- */ 1271 // éã 1272 $btnOpen2.on('click', function(){ 1273 $search.animate({ 1274 opacity: 'show', 1275 height: 'show' 1276 }); 1277 $page2.addClass('is-active'); 1278 return false; 1279 }); 1280 1281 // éãã 1282 $btnClose2.on('click', function(){ 1283 $search.animate({ 1284 opacity: 'hide', 1285 height: 'hide' 1286 }); 1287 $page2.removeClass('is-active'); 1288 return false; 1289 }); 1290 1291 }, 1292 1293 1294 1295 1296 1297 /* 1298 * @method pcGNavControl 1299 * - PCã¡ã¬ã¡ãã¥ã¼å¶å¾¡ 1300 */ 1301 pcGNavControl: function(){ 1302 /* vars 1303 ------------------------------- */ 1304 var nav = '#navGlobal:not(.presetDc )', 1305 frame = '.frame01', 1306 btnOpen = '.nav01 > li', 1307 btnClose = ".btn01 > a", 1308 classNameOpen = 'open'; 1309 speed = 600; 1310 1311 if(($(nav).length == 0 && !(u.isRangeSP())) ){ 1312 return false; 1313 } 1314 1315 /* trigger 1316 ------------------------------- */ 1317 // éãã 1318 $(btnClose, nav).on('click', function(){ 1319 $(this).closest(frame).animate({ 1320 opacity: 'hide', 1321 height: 'hide' 1322 }, speed, function(){ 1323 }).closest('li').removeClass(classNameOpen); 1324 return false; 1325 }); 1326 1327 if(u.isRangePC()){ 1328 // éãï¼PCï¼ 1329 $(btnOpen, nav).on({ 1330 'mouseenter': function(){ 1331 if($('a', this).next(frame).length > 0){ 1332 $('a', this).parent().toggleClass(classNameOpen).siblings().removeClass(classNameOpen).find(frame).hide(); 1333 $('a', this).next(frame).stop(true, true).delay(200).animate({ 1334 opacity: 'toggle', 1335 height: 'toggle' 1336 }, speed); 1337 } 1338 }, 1339 'mouseleave': function(){ 1340 $('a', this).parent().toggleClass(classNameOpen).siblings().removeClass(classNameOpen).find(frame).hide(); 1341 $('a', this).next(frame).stop(true, true).animate({ 1342 opacity: 'hide', 1343 height: 'hide' 1344 }, speed, function(){ 1345 }).closest('li').removeClass(classNameOpen); 1346 } 1347 }); 1348 1349 // éãï¼focusinï¼ 1350 $(btnOpen, nav).on(
1351 'focusin', function(){ 1352 if($('a', this).next(frame).length > 0 && $("a", this).next(frame).is(':hidden')){ 1353 $('a', this).parent().toggleClass(classNameOpen).siblings().removeClass(classNameOpen).find(frame).hide(); 1354 $('a', this).next(frame).stop(true, true).delay(0).animate({ 1355 opacity: 'toggle', 1356 height: 'toggle' 1357 }, speed); 1358 } else { 1359 $('a', this).parent().toggleClass(classNameOpen).siblings().removeClass(classNameOpen).find(frame).hide(); 1360 $('a', this).next(frame).stop(true, true).animate({ 1361 opacity: 'hide', 1362 height: 'hide' 1363 }, speed, function(){ 1364 }).closest('li').removeClass(classNameOpen); 1365 } 1366 return false; 1367 }); 1368 //éãã 1369 $(frame, nav).on('focusin', function(e){ 1370 e.stopPropagation(); 1371 }); 1372 u.$doc.on('focusin', function(){ 1373 $(frame, nav).animate({ 1374 opacity: 'hide', 1375 height: 'hide' 1376 }, speed, function(){ 1377 }).closest('li').removeClass(classNameOpen); 1378 }); 1379 } 1380 1381 if(u.isTablet()){ 1382 // éãï¼Tabletï¼ 1383 $(btnOpen, nav).on('click touchend', function(){ 1384 if($('a', this).next(frame).length > 0 && $("a", this).next(frame).is(':hidden')){ 1385 $('a', this).parent().toggleClass(classNameOpen).siblings().removeClass(classNameOpen).find(frame).hide(); 1386 $('a', this).next(frame).stop(true, true).delay(200).animate({ 1387 opacity: 'toggle', 1388 height: 'toggle' 1389 }, speed); 1390 } else { 1391 $('a', this).parent().toggleClass(classNameOpen).siblings().removeClass(classNameOpen).find(frame).hide(); 1392 $('a', this).next(frame).stop(true, true).animate({ 1393 opacity: 'hide', 1394 height: 'hide' 1395 }, speed, function(){ 1396 }).closest('li').removeClass(classNameOpen); 1397 } 1398 return false; 1399 }); 1400 1401 // éããï¼Tabletï¼ 1402 $(frame, nav).on('click touchend', function(e){ 1403 e.stopPropagation(); 1404 }); 1405 u.$doc.on('click touchend', function(){ 1406 $(frame, nav).animate({ 1407 opacity: 'hide', 1408 height: 'hide' 1409 }, speed, function(){ 1410 }).closest('li').removeClass(classNameOpen); 1411 }); 1412 } 1413 1414 }, 1415 1416 /* 1417 * @method pcLNavControl 1418 * - PCå·¦ããå¶å¾¡ 1419 */ 1420 pcLNavControl: function(){ 1421 /* element 1422 ------------------------------- */ 1423 var $aside = $('#aside'); 1424 if($aside.length === 0){ return false; } 1425 1426 /* vars 1427 ------------------------------- */ 1428 var myLocation = location.pathname.replace(/(^\/|\/$|\/index\.html)/g,''), // index.htmlã¯é¤ã 1429 dirArr = myLocation.split('/'), //ãã£ã¬ã¯ããªåãé åã«æ ¼ç´ 1430 dirLength = dirArr.length, //ãã¹ã®æ° 1431 currentDir = dirLength + 1, //éå±¤æ° 1432 openName = 'open', 1433 onName = 'on', 1434 urlArr = [], 1435 _href = '', 1436 i; 1437 1438 /* hrefãå®ç¾© 1439 ------------------------------- */ 1440 // é層é ã«ã«ã¼ãå¦ç 1441 for(i = 0; i < dirLength; i++){ 1442 var createPath = dirArr[i].match(/\./) ? dirArr[i] : dirArr[i] + '/'; 1443 urlArr.push(createPath); 1444 _href = '/' + urlArr.join(""); 1445 } 1446 1447 /* init 1448 ------------------------------- */ 1449 var $target = $aside.find('[class*="nav' + currentDir + '"] > li > a[href*="' + _href + '"]').parent("li"), 1450 parentsDir; 1451 // å·¦ããã«ç¡ãå ´å 1452 if($target.length === 0){ 1453 //detail.htmlå¶å¾¡ç¨ã以éã®å¦çã¯createJson.jsã§å¯¾å¿ 1454 if(myLocation.match("site/seminar/detail.html")){ 1455 return false; 1456 } 1457 var _hrefNone = _href.replace(/\/(.*)\/(.*)\.html/g, "/$1/"); 1458 $target = $aside.find('a[href*="' + _hrefNone + '"]').parent("li"); 1459 } 1460 // ç¾å¨å°ã«onNameãSet 1461 $target.addClass(onName); 1462 // 親é層ã«openNameãSet 1463 for(parentsDir = currentDir; parentsDir > 2; parentsDir--){ 1464 $target.parents('[class*="nav' + parentsDir + '"] > li').addClass(openName); 1465 } 1466 1467 }, 1468 1469 /* 1470 * @method footNavControl 1471 * - TABããã¿ã¼ããå¶å¾¡ 1472 */ 1473// footNavControl: function(){ 1474// var $targetNav = $("#footer01 .col03 .nav2nd > li:first-child"), 1475// $destination = $("#footer01 .col01 .nav2nd"); 1476// if(u.isRangeTL()){ 1477// $($targetNav).appendTo($destination); 1478// } 1479// }, 1480 /* 1481 * @method bookmark 1482 * - ãæ°ã«å ¥ãç»é² 1483 */ 1484 bookmark: function(config){ 1485 var c = $.extend({ 1486 elmClass: ".icnBookmark", 1487 activeName: "active" 1488 }, config); 1489 1490 if($(c.elmClass).length === 0){ return false; } 1491 1492 $(c.elmClass).on("click", function(){ 1493 if(!$(this).hasClass(c.activeName)){ 1494 $(this).addClass(c.activeName); 1495 } else { 1496 $(this).removeClass(c.activeName); 1497 } 1498 }); 1499 }, 1500 1501 /* 1502 * @method accountForm 1503 * - å£åº§é¸æ 1504 */ 1505 accountForm: function(){ 1506 var elmClass = ".accountForm", 1507 sectionClass = ".accountFormSection", 1508 labelClass = ".accountFormLabel", 1509 bodyClass = ".accountFormBody", 1510 btnClass = ".accountFormCheckAllBtn", 1511 sendClass = ".sendFormBtn", 1512 activeName = "active", 1513 speed = 200, 1514 over_flg = false;
1515 1516 if($(elmClass).length === 0){ return false; } 1517 1518 var watchCheckState = function(obj, checkbox){ 1519 var $wrap = $(obj).closest(sectionClass), 1520 $target = $wrap.find(bodyClass); 1521 1522 if(checkbox.is(":checked")){ 1523 $target.stop(true, true).slideDown(speed); 1524 $target.find('input[type="checkbox"]') 1525 .prop("disabled", false); 1526 } else { 1527 $target.stop(true, true).slideUp(speed); 1528 $target.find('input[type="checkbox"]') 1529 .prop("disabled", true); 1530 } 1531 } 1532 1533 // event HOVER 1534 $(btnClass, $(elmClass)).hover(function(){ 1535 over_flg = true; 1536 }, function(){ 1537 over_flg = false; 1538 }); 1539 1540 $(".accountFormLinkBtn", $(elmClass)).hover(function(){ 1541 over_flg = true; 1542 }, function(){ 1543 over_flg = false; 1544 }); 1545 1546 // event CLICK 1547 $(labelClass, $(elmClass)).on("click", function(){ 1548 if(!over_flg){ 1549 var childCheckBox = $(this).find('input[type="checkbox"]').not('[name="multiAnswer(ANSWER33)"]'); 1550 1551 if(childCheckBox.is(":checked")){ 1552 childCheckBox.prop("checked", false); 1553 } else { 1554 childCheckBox.prop("checked", true); 1555 } 1556 1557 watchCheckState(this, childCheckBox); 1558 } 1559 }); 1560 1561 $(btnClass, $(elmClass)).on("click", function(){ 1562 var wrapSection = $(this).closest(sectionClass), 1563 wrapLable = $(this).closest(labelClass), 1564 wrapBody = wrapSection.find(bodyClass), 1565 allCheckBox = wrapSection.find('input[type="checkbox"]'), 1566 labelCheckBox = wrapLable.find('input[type="checkbox"]'), 1567 bodyCheckBox = wrapBody.find('input[type="checkbox"]'); 1568 1569 if(allCheckBox.length === wrapSection.find('input[type="checkbox"]:checked').length){ 1570 bodyCheckBox.prop("checked", false); 1571 } else { 1572 allCheckBox.prop("checked", true); 1573 } 1574 1575 watchCheckState(wrapLable, labelCheckBox); 1576 }); 1577 1578 // event LOAD 1579 $(labelClass, $(elmClass)).each(function() { 1580 var childCheckBox = $(this).find('input[type="checkbox"]'); 1581 1582 if(!childCheckBox.prop("checked")){ 1583 $(this).closest(sectionClass) 1584 .find(bodyClass) 1585 .hide(); 1586 } else { 1587 $(this).closest(sectionClass) 1588 .find(bodyClass) 1589 .show(); 1590 } 1591 1592 //watchCheckState(this, childCheckBox); 1593 }); 1594 1595 // send FORM 1596 $(sendClass, $(elmClass)).on("click", function(){ 1597 var wrapSection = $(this).parents(elmClass), 1598 checkedElm = wrapSection.find('input[id*="accountForm"]:checked'), 1599 checkedLength = checkedElm.length, 1600 kouzaElm = wrapSection.find('input[name*="ANSWER33"]'), 1601 href = $(this).attr("href"), 1602 hasName = "", 1603 sendUrl = href; 1604 1605 if(kouzaElm.prop("checked")){ 1606 sendUrl += "?req=ANSWER33"; 1607 } 1608 1609 if(checkedLength){ 1610 checkedElm.each(function(i){ 1611 hasName = $(this).attr("id").replace("accountFormCheck", ""); 1612 if(i == 0 && !kouzaElm.prop("checked")){ 1613 sendUrl += "?req=" + hasName; 1614 } else { 1615 sendUrl += "&req=" + hasName; 1616 } 1617 }); 1618 } 1619 1620 window.location.href = sendUrl; 1621 return false; 1622 }); 1623 }, 1624 1625 /* 1626 * @method tableAccordion 1627 * - 表çµã¿ã¢ã³ã¼ãã£ãªã³ 1628 */ 1629 tableAccordion: function(){ 1630 var elmClass = ".tableAccordion", 1631 bodyClass = ".toggleItem", 1632 btnClass = ".toggleBtn", 1633 activeName = "active", 1634 openName = "open", 1635 speed = 200; 1636 1637 if($(elmClass).length === 0){ return false; } 1638 1639 $(bodyClass, $(elmClass)).hide(); 1640 1641 $(btnClass).on("click", function(){ 1642 var parentRow = $(this).closest("tr"), 1643 targetRow = parentRow.next("tr"); 1644 1645 if(targetRow.hasClass(openName)){ 1646 $(this).removeClass(activeName); 1647 targetRow.removeClass(openName); 1648 targetRow.find(bodyClass) 1649 .stop(true, true).slideUp(speed); 1650 } else { 1651 $(this).addClass(activeName); 1652 targetRow.addClass(openName); 1653 targetRow.find(bodyClass) 1654 .stop(true, true).slideDown(speed); 1655 } 1656 }); 1657 }, 1658 1659 /** 1660 * @method addTelLink 1661 */ 1662 addTelLink: function(){ 1663 var $elm = $("span.telLink"); 1664 1665 if(!u.isSmartphone() || $elm.length === 0){ return false; } 1666 1667 $elm.each(function(){ 1668 var src = $(this).html(), 1669 telLink; 1670 1671 if(src.match(/(\d+)(-\d+)+/)){ 1672 telLink = src.replace(/(\d+)((-\d+)+)/g, '<a href="tel:' + '$1$2' + '" class="telLink">' + '$1$2' + '</a>'); 1673 } else if(src.match(/(\d+)/)){ 1674 telLink = src.replace(/(\d+)/, '<a href="tel:' + '$1' + '" class="telLink">' + '$1' + '</a>'); 1675 } 1676 $(this).replaceWith(telLink); 1677 }); 1678 }, 1679 1680 /** 1681 * @method checkAll 1682 */ 1683 checkAll: function(){ 1684 var $elm = $(".checkAll"); 1685 1686 if($elm.length === 0){ return false; } 1687 1688 $elm.each(function(){ 1689 var $this = $(this), 1690 $parent = $this.parent(), 1691 $brother = $("> *", $parent), 1692 brotherL = $brother.not(".checkAll").length, 1693 inputSrc = 'input[type="checkbox"]'; 1694 1695 if($(this).find(inputSrc).prop("checked")){ 1696 $brother.find(inputSrc).prop("checked", true); 1697 } 1698 1699 $this.on("click", function(){ 1700 if(!$(this).find(inputSrc).prop("checked")){ 1701 $parent.find(inputSrc).prop("checked", true); 1702 } else { 1703 $parent.find(inputSrc).prop("checked", false); 1704 } 1705 }); 1706 1707 $brother.on("click", function(){ 1708 if(!$(this).find(inputSrc).prop("checked")){ 1709 $this.find(inputSrc).prop("checked", false); 1710 } 1711 if($parent.find(inputSrc + ":checked").length == (brotherL)){ 1712 $this.find(inputSrc).prop("checked", true); 1713 } 1714 }); 1715 }); 1716 }, 1717 1718 /** 1719 * @method fundSearch 1720 */ 1721 fundSearch: function(config){ 1722 var c = $.extend({
1723 elmName: ".fundSearchWrap", 1724 submitName: ".brandInformationSubmit", 1725 postUrl: "http://qw144.qhit.net/okasan/#sch" 1726 }, config); 1727 1728 if($(c.elmName).length === 0){ return false; } 1729 1730 $(c.elmName).each(function(){ 1731 var $kwd = $('input[name="kwd"]', this), 1732 $mkt = $(".fundFormCheckList", this), 1733 $sec = $(".styledSelect", this), 1734 $submit = $(c.submitName, this), 1735 src = "", 1736 kwdVal = ""; 1737 1738 function fundFormSubmit(){ 1739 // æ¤ç´¢URLãåæå 1740 src = c.postUrl; 1741 1742 // ãã¼ã¯ã¼ã 1743 if($kwd.val() != ""){ 1744 kwdVal = encodeURIComponent($kwd.val()); 1745 src += "?kwd=" + kwdVal; 1746 } else { 1747 src += "?kwd="; 1748 } 1749 1750 // å¸å ´ 1751 if($mkt.find("input:checked").length){ 1752 $mkt.find("li").each(function(i){ 1753 if(i === 0 && $(this).find("input:checked").length){ 1754 src += "&mkt="; 1755 return false; 1756 } 1757 if($(this).find("input:checked").length){ 1758 src += "&mkt=" + $(this).find("input").val(); 1759 } 1760 }); 1761 } else { 1762 src += "&mkt="; 1763 } 1764 1765 // æ¥ç¨® 1766 if($sec.val() != ""){ 1767 src += "&sec=" + $sec.val(); 1768 } else { 1769 src += "&sec="; 1770 } 1771 1772 window.open(src, "_blank"); 1773 } 1774 1775 $submit.on("click", function(){ 1776 fundFormSubmit(); 1777 return false; 1778 }); 1779 }); 1780 }, 1781 1782 /** 1783 * @method directCheck 1784 */ 1785 directCheck: function(config){ 1786 var c = $.extend({ 1787 elmName: "#directCheck" 1788 }, config); 1789 1790 if($(c.elmName).length === 0){ return false; } 1791 1792 var href = window.location.href; 1793 1794 $(c.elmName).find(".accountFormLabel.hasDetails").each(function(){ 1795 if(!$(this).next(".accountFormBody").find("input:checked").length){ 1796 $(this).find("input").prop("checked", false); 1797 $(this).next(".accountFormBody").hide(); 1798 } 1799 }); 1800 1801 if(href.match(/\?req/)){ 1802 var param = href.split("?req=")[1], 1803 paramLength = ""; 1804 1805 if(param.match(/ANSWER33/)){ 1806 $('input[name*="ANSWER33"]').prop("checked", true); 1807 } 1808 1809 if(param.match(/\&req/)){ 1810 param = param.split("&req="); 1811 paramLength = param.length; 1812 1813 for(var i = 0; i < paramLength; i++){ 1814 $("input#accountFormCheck" + param[i]).prop("checked", true); 1815 } 1816 } else { 1817 $("input#accountFormCheck" + param).prop("checked", true); 1818 } 1819 } 1820 } 1821 1822 } 1823 1824}(); 1825 1826 1827 1828/* ------------------------------------------- 1829 * @init 1830------------------------------------------- */ 1831$(function(){ 1832 var u = new OKASAN.Util(); 1833 1834 OKASAN.module.initialize(); 1835 1836 // ãããã¼ãªã³ã¯è¨å® 1837 var ua = navigator.userAgent.toLowerCase(), 1838 target = ".application", 1839 url = ""; 1840 1841 if($('[class*="headerLink"]').length || $(".appLinkBtn").length){ 1842 if(u.isTablet()){ 1843 if(ua.indexOf('ipad') != -1){ 1844 url = "https://itunes.apple.com/jp/app/id915702677"; 1845 $(target, ".headerLinkTb,.appLinkBtn").find("a").attr("href", url); 1846 } else if(ua.indexOf('android') != -1 && ua.indexOf('mobile') == -1){ 1847 url = "https://play.google.com/store/apps/details?id=jp.co.okasan.android.okasantrade"; 1848 $(target, ".headerLinkTb,.appLinkBtn").find("a").attr("href", url); 1849 } 1850 } else if(u.isSmartphone()){ 1851 if(ua.indexOf('iphone') != -1 || ua.indexOf('ipod') != -1){ 1852 url = "https://itunes.apple.com/jp/app/id586518740"; 1853 $(target, ".headerLinkSp,.appLinkBtn").find("a").attr("href", url); 1854 } else if(ua.indexOf('android') != -1 && ua.indexOf('mobile') != -1){ 1855 url = "https://play.google.com/store/apps/details?id=com.ohs.ot"; 1856 $(target, ".headerLinkSp,.appLinkBtn").find("a").attr("href", url); 1857 } 1858 } 1859 } 1860 1861 1862 // ãããã¼æ¤ç´¢çª 1863 $(".stockBtn").on("click", function(){ 1864 var keyword = $(".keyMirror").val(); 1865 $(".keyMirror2").val(keyword); 1866 $(".stockSearch").submit(); 1867 return false; 1868 }); 1869 $(".stockBtnSP").on("click", function(){ 1870 var keyword = $(".keyMirrorSP").val(); 1871 $(".keyMirror2SP").val(keyword); 1872 $(".stockSearchSP").submit(); 1873 return false; 1874 }); 1875 if ( $("#headerSearch01").length && u.isRangeSP()) { 1876 $("#headerSearch01").prependTo("#search .menuSearch01"); 1877 } 1878 1879 // equalHeight 1880 $('[class*="columnEq"], [class*="linkListBtnColumn"], .navAnchor01 .nav01, .navAnchor02 .nav01, .boxTab01 .tab01 .nav01').addClass('equalHeight'); 1881 $('.columnFrame01').each(function(){ 1882 $(this).addClass('equalHeight').find('.boxFrame01, .boxFrame02').addClass('eqChild01'); 1883 }); 1884 1885 //ãã¡ã¤ã«ãµã¤ãºåå¾ã@require auto_filesize-1.0.2.js 1886 if ($(".auto_filesize").length){ 1887 $(".auto_filesize").auto_filesize({ 1888 'size_part' : 'size01' 1889 ,'wrap' : '' 1890 }); 1891 } 1892 1893 /* ãã¼ãæ */ 1894 u.$win.on('load', function(){ 1895 OKASAN.module.sizeFix(); 1896 OKASAN.module.equalWidth(true, true); 1897 OKASAN.module.equalHeight(true, true); 1898 }); 1899 1900 // ãªãµã¤ãºæ 1901 u.$win.on("orientationchange resize", function(){ 1902 OKASAN.module.sizeFix(); 1903 }); 1904 1905 // .nav01.spNoneParentCol ã®åè¦ç´ ã«spNoneãããå ´åã®å¦ç 1906 $(".nav01.spNoneParentCol").each(function(){ 1907 var cuntChild = $(this).children("li:visible"); 1908 var val = cuntChild.length; 1909 cuntChild.slice(0,2).addClass("jsClearHeadSp"); 1910 var flg; 1911 for(i=0; i <= val; i++){ 1912 if(flg === true) { 1913 if((i % 2 ) == 0) { 1914 cuntChild.eq(i-1).addClass("jsClearSp"); 1915 } 1916 } 1917 flg = true; 1918 } 1919 }); 1920 1921 1922 //SPã¡ãã¥ã¼ ã¢ã³ã¼ãã£ãªã³ 1923 if (u.isRangeSP()){ 1924 OKASAN.module.accordion({ 1925 targetWrap: ".menuLink01", 1926 toggleFrameClass: ".spMenuAccord", 1927 toggleBtnClass: ".spMenuAccord .hdg01", 1928 togglePanelClass: ".menuAccordDetail", 1929 slideSpeed : 400 1930 }); 1931 } 1932});
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.