1;jQuery(function($){ 2 // ã¡ãã£ã¢ã¯ã¨ãªã«ããç¾å¨ã®è¡¨ç¤ºç¶æ 3 window.viewMedia = 'sp'; 4 var matchMedia = window.matchMedia('(max-width: 767px)'); 5 var onChangeMedia = function (e) { 6 if (e.matches) { 7 window.viewMedia = 'sp'; 8 } else { 9 window.viewMedia = 'pc'; 10 } 11 } 12 matchMedia.addListener(onChangeMedia); 13 onChangeMedia(matchMedia); 14 15 ////////////////////////////////////////////// 16 // 17 // ããã¼ã¸ãããã¸ãã®è¡¨ç¤º 18 // 19 ////////////////////////////////////////////// 20 $('.pageTop').hide(); 21 $(window).scroll(function () { 22 var scrollHeight = $(document).height(); 23 var scrollPosition = $(window).height() + $(window).scrollTop(); 24 var topSpan = 100; //ä¸ç«¯ããâpxã§è¡¨ç¤º 25 var bottomSpan = 100; //ä¸ç«¯ããâpxã§é表示 26 27 //ãä¸ç«¯ããâpxã§è¡¨ç¤ºã 28 if ($(this).scrollTop() > topSpan ) { 29 $('.pageTop').fadeIn(); 30 } else { 31 $('.pageTop').fadeOut(); 32 } 33 }); 34 35 ////////////////////////////////////////////// 36 // 37 // ã¹ã¯ãã¼ã«é¢é£ãâ»é«ãæããå¦çããå¾ã«å ¥ãã 38 // 39 ////////////////////////////////////////////// 40 // ãã¼ã¸ããã㸠41 $('.pageTopFix, .pageTop, .pageTopBlock').targetScroller({ 42 target: 'html', 43 duration: 800, 44 easing: 'easeOutQuint' 45 }); 46 // ãµã¤ãå ãªã³ã¯ 47 $('a[href^="#"]').targetScroller({ 48 duration: 800, 49 easing: 'easeOutQuint', 50 header: 'div.site-header' 51 }); 52 // ãµã¤ãå ãªã³ã¯ 53 $('a[href^="/#"]').targetScroller({ 54 duration: 800, 55 easing: 'easeOutQuint', 56 header: 'div.site-header' 57 }); 58 // ããã·ã¥ã«ãããã¼ãæã®ã¹ã¯ãã¼ã« 59 $.targetScroller({ 60 duration: 800, 61 easing: 'easeOutQuint', 62 header: 'div.site-header' 63 }); 64 65 66 67 68 ////////////////////////////////////////////// 69 // 70 // SlickSlider 71 // 72 ////////////////////////////////////////////// 73 if ($('.mainSlider').length) { 74 $(".mainSlider").slick({ 75 infinite: true, 76 arrows:false, 77 slidesToShow: 3, 78 centerMode: true, 79 variableWidth: true, 80 autoplay: true, 81 speed: 500, 82 autoplaySpeed: 4000, 83 swipe: false, 84 responsive: [ 85 { 86 breakpoint: 768, 87 settings: { 88 slidesToShow: 3, 89 } 90 } 91 ] 92 }); 93 } 94 95 if ($('.pageIndex.top .slickSlider').length) { 96 97 $(".slickSlider").slick({ 98 dots: false, 99 infinite: false, 100 arrows:true, 101 slidesToShow: 3, 102 variableWidth: true, 103 prevArrow: '<button class="button slide-arrow prev">PREV</button>', 104 nextArrow: '<button class="button slide-arrow next">NEXT</button>', 105 responsive: [ 106 { 107 breakpoint: 1024, 108 settings: { 109 slidesToShow: 2, 110 } 111 112 }, 113 { 114 breakpoint: 768, 115 settings: { 116 centerMode: true, 117 variableWidth: false, 118 slidesToShow: 1, 119 } 120 } 121 ] 122 123 124 125 }); 126 } 127 if ($('.pageIndex.category .slickSlider.list').length) { 128 $(".slickSlider").slick({ 129 dots: false, 130 infinite: false, 131 arrows:true, 132 slidesToShow: 3, 133 variableWidth: true, 134 prevArrow: '<button class="button slide-arrow prev">PREV</button>', 135 nextArrow: '<button class="button slide-arrow next">NEXT</button>', 136 responsive: [ 137 { 138 breakpoint: 768, 139 settings: { 140 variableWidth: false, 141 slidesToShow: 2, 142 } 143 } 144 ] 145 }); 146 } 147 if ($('.bannerSlider').length) { 148 $(".bannerSlider").slick({ 149 dots: false, 150 infinite: true, 151 arrows:false, 152 slidesToShow: 1, 153 centerMode: true, 154 variableWidth: true, 155 autoplay: true, 156 speed: 500, 157 autoplaySpeed: 4000, 158 responsive: [ 159 { 160 breakpoint: 768, 161 settings: { 162 dots: true, 163 variableWidth: false, 164 centerMode: true, 165 } 166 } 167 ] 168 }); 169 } 170 if ($('.pageProducts.detail .reccomendItem').length) { 171 $(".reccomendItem").slick({ 172 dots: false, 173 arrows:true, 174 slidesToShow: 5, 175 slidesToScroll: 5, 176 variableWidth: true, 177 responsive: [{ 178 breakpoint: 768, 179 settings: { 180 arrows:true, 181 slidesToShow: 3, 182 slidesToScroll: 3, 183 } 184 },{ 185 breakpoint: 480, 186 settings: { 187 arrows:true, 188 slidesToShow: 2, 189 slidesToScroll: 2, 190 } 191 } 192 ] 193 }); 194 } 195 196 if ($('.voiceList').length) { 197 $(".voiceList").slick({ 198 dots: true, 199 infinite: true, 200 arrows:false, 201 slidesToShow: 3, 202 centerMode: true, 203 variableWidth: true, 204 responsive: [ 205 { 206 breakpoint: 768, 207 settings: { 208 slidesToShow: 1, 209 centerMode: false, 210 variableWidth: false, 211 } 212 } 213 ] 214 }); 215 } 216 217 218 219 if ($('.bxslider').length) { 220 $('.bxslider').bxSlider({
221 auto: false, 222 mode: 'horizontal', 223 speed: 500, 224 minSlides: 1, 225 pager: false 226 }); 227 } 228 229 if ($('.bxslider_smooth').length) { 230 var slideSpeed = 6000; 231 var slideLength = $('.bxslider_smooth li').length; 232 if ($('.bxslider_smooth li').length > 3) { 233 $('.bxslider_smooth').bxSlider({ 234 mode: 'horizontal', 235 ticker: true, 236 minSlides: 3, 237 maxSlides: 4, 238 slideWidth: 210, 239 slideMargin: 20, 240 tickerHover: true, 241 speed: slideSpeed * slideLength 242 }); 243 } 244 } 245 246 if ($('.sp-bxslider').length) { 247 var changeSpSlider = function () { 248 $('.sp-bxslider').each(function () { 249 var $this = $(this); 250 if ('sp' === viewMedia) { 251 if (!$this.hasClass('activeSlider')) { 252 var option = { 253 auto: true, 254 mode: 'horizontal', 255 speed: 500, 256 minSlides: 1, 257 pager: false, 258 controls: false 259 }; 260 if ($this.attr('data-slider-auto')) { 261 option.auto = $this.attr('data-slider-auto').toLowerCase() === 'true'; 262 } 263 if ($this.attr('data-slider-controls')) { 264 option.controls = $this.attr('data-slider-controls').toLowerCase() === 'true'; 265 } 266 if ($this.attr('data-slider-margin')) { 267 option.slideMargin = parseInt($this.attr('data-slider-margin').toLowerCase()); 268 } 269 this.slider = $this.bxSlider(option); 270 $this.addClass('activeSlider'); 271 } 272 } else if ('pc' === viewMedia) { 273 if ($this.hasClass('activeSlider')) { 274 this.slider.destroySlider(); 275 $this.removeClass('activeSlider'); 276 } 277 } 278 }); 279 }; 280 281 $(window).resize(changeSpSlider); 282 changeSpSlider(); 283 } 284 285 286 ////////////////////////////////////////////// 287 // 288 // é«ããããã 289 // 290 ////////////////////////////////////////////// 291 if ($('.pageIndex .trivia .reasonList').length) { 292 $('.pageIndex .trivia .reasonList dl').matchHeight(); 293 } 294 if ($('.pageIndex.mochu .design designList').length) { 295 $('.pageIndex.mochu .design designList li a').matchHeight(); 296 } 297 298 if ($('.pageGuide .howto .row').length) { 299 $('.pageGuide .howto .row .matchHeight').matchHeight(); 300 } 301 if ($('.pageGuide .howto .row').length) { 302 $('.pageGuide .howto .row div').matchHeight(); 303 $('.pageGuide .howto .row .matchHeight').matchHeight(); 304 $('.pageGuide .howto .row .matchHeight dt').matchHeight(); 305 $('.pageGuide .howto .row .matchHeight .matchHeight2').matchHeight(); 306 } 307 if ($('.pageGuide .choiceSub02 .typenaviSub3').length) { 308 $('.pageGuide .choiceSub02 .typenaviSub3 .matchHeight').matchHeight(); 309 } 310 311 if ($('.pageUserdata.faq .faqBox').length) { 312 $('.pageUserdata.faq .faqBox .detail .detailBtn').matchHeight(); 313 } 314 if ($('.pageIndex .imageOrder .image').length) { 315 $('.pageIndex .imageOrder .image div a').matchHeight(); 316 $('.pageIndex .imageOrder .image div a small').matchHeight(); 317 } 318 319 if ($('.pagePhotobook .stepList').length) { 320 $('.pagePhotobook .stepList dl').matchHeight(); 321 } 322 if ($('.pageVoice .voiceArea .voiceBox').length) { 323 $('.pageVoice .voiceArea .voiceBox .text').matchHeight(); 324 } 325 326 327 328 // .sameHeightGroup å ã® .sameHeight ã®é«ããä¸çªå¤§ãããã®ã«ãã¹ã¦æãã 329 if ($('.sameHeightGroup').length) { 330 var sameHeight = function () { 331 $('.sameHeightGroup').each(function (key, item) { 332 var $targetList = $('.sameHeight', item); 333 var newHeight = 0; 334 $targetList.each(function (key, item) { 335 $(item).height(''); 336 }); 337 // ä¸çªé«ããã®ã®é«ããåå¾ãã 338 $targetList.each(function (key, item) { 339 var height = $(item).outerHeight(); 340 if (newHeight < height) { 341 newHeight = height; 342 } 343 }); 344 // ä¸çªé«ããã®ã«æãã 345 $targetList.each(function (key, item) { 346 $(item).height(newHeight); 347 }); 348 }); 349 }; 350 $(window).resize(sameHeight); 351 sameHeight(); 352 } 353 354 355
356 ////////////////////////////////////////////// 357 // 358 // ç¹æ®æåã¢ã¤ã³ã³ 359 // 360 ////////////////////////////////////////////// 361 if ($('input[type="text"]').length) { 362 363 $('input[type="text"]').focus(function(){ 364 $('input[type="text"]').siblings('.balloon').removeClass('active'); 365 $(this).siblings('.balloon').addClass('active'); 366 }); 367 368 $('input[type="text"]').blur(function(){ 369 $(this).siblings('.balloon').delay(250).queue(function(){ 370 $(this).removeClass('active').dequeue(); 371 }); 372 }); 373 374 $('input[type="text"] + .balloon').click(function(){ 375 $(this).removeClass('active'); 376 }); 377 } 378 379 $('.favoriteButton').click(function (e) { 380 var data = { 381 mode: 'toggle', 382 product_id: $(this).attr('data-product-id') 383 } 384 $.ajax({ 385 type: 'GET', 386 url: '/user_data/favorite.php', 387 data: data, 388 cache: false, 389 dataType: 'json', 390 success: function (data, dataType) { 391 console.log(data.data.count); 392 393 if ('success' === data.result) { 394 $('.favoriteButton[data-product-id="' + data.data.product_id + '"]').toggleClass('active'); 395 if ($('.favoriteButton').hasClass('active')) { 396 $('.favoriteButton').text('ãæ°ã«å ¥ãç»é²æ¸ã¿'); 397 } else { 398 $('.favoriteButton').text('ãæ°ã«å ¥ãç»é²ãã'); 399 } 400 401 if ($('#FavoriteCount').length) { 402 $('#FavoriteCount').text(data.data.count); 403 } 404 } else { 405 } 406 } 407 }); 408 return false; 409 }); 410 411 if ($('#estimateResult').length) { 412 var estimateShowAlways = $('#estimateResult:visible').length; 413 var estimateNeedUpdate = false; 414 var estimateElement = { 415 $category: $('#estimateCategory'), 416 $product_id: $('#estimateProductId'), 417 $atena: $('#estimateAtenaPrint'), 418 $quantity: $('#estimateQuantity'), 419 $link: $('#estimateLink') 420 }; 421 var estimatePrice = function () { 422 var data = { 423 mode: 'estimate', 424 method: 'ajax', 425 category: estimateElement.$category.find('option:selected').val(), 426 product_id: estimateElement.$product_id.val(), 427 is_atena_print: estimateElement.$atena.find('option:selected').val(), 428 quantity: estimateElement.$quantity.val() 429 }; 430 $('#categoryError').text(''); 431 $('#quantityError').text(''); 432 if ('' === data.category 433 || 0 == data.category 434 || '' === data.quantity 435 ) { 436 $('#estimateResult .dynamic').text(0); 437 if (!estimateShowAlways) $('#estimateResult').hide(); 438 return; 439 } 440 $.ajax({
441 type: 'GET', 442 url: location.pathname, 443 data: data, 444 cache: false, 445 dataType: 'json', 446 error: ajaxError, 447 success: function (data, status, xhr) { 448 $('#estimateResult .dynamic').text(0); 449 if (data.error) { 450 if (!estimateShowAlways) $('#estimateResult').hide(); 451 ajaxError(); 452 return; 453 } 454 455 if (data.result) { 456 $.each(data.result, function (index, value) { 457 $('#estimateResult .' + index).html(value.toLocaleString()); 458 }); 459 if (!estimateShowAlways) $('#estimateResult').show(); 460 } else if (data.invalid) { 461 if (!estimateShowAlways) $('#estimateResult').hide(); 462 $.each(data.invalid, function (index, value) { 463 $('#' + index + 'Error').html('<p class="error">' + value + '</p>'); 464 }); 465 } else if (data.message) { 466 customAlert(data.message); 467 } else { 468 ajaxError(); 469 } 470 } 471 }); 472 }; 473 var setEstimateLink = function () { 474 if (estimateElement.$link.length) { 475 var category = estimateElement.$category.find('option:selected').val(); 476 var url = estimateElement.$link.attr('href'); 477 if (category.length > 0) { 478 url = url + '?category_id=' + category; 479 } 480 estimateElement.$link.get(0).href = url; 481 } 482 }; 483 var ajaxError = function () { 484 customAlert('éä¿¡ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã'); 485 }; 486 estimateElement.$category.change(function (e) { 487 //setEstimateLink(); 488 estimateNeedUpdate = true; 489 }); 490 estimateElement.$quantity.keyup(function (e) { 491 estimateNeedUpdate = true; 492 }); 493 estimateElement.$quantity.change(function (e) { 494 estimateNeedUpdate = true; 495 }); 496 setInterval(function(){ 497 if (estimateNeedUpdate) { 498 estimateNeedUpdate = false; 499 estimatePrice(); 500 } 501 }, 500); 502 503 estimatePrice(); 504 //setEstimateLink(); 505 } 506 507 $('.floatingFooter .closeButton').click(function (e) { 508 $(this).parents('.floatingFooter').remove(); 509 }); 510 511 ////////////////////////////////////////////// 512 // 513 // ãã©ã¤ãã·ã¼ããªã·ã¼ã«åæãã¦éä¿¡ 514 // 515 ////////////////////////////////////////////// 516 if ($('.form-agreement').length) { 517 function chkAgreement() { 518 if ($('.form-agreement:not(:checked)').length) { 519 $('.form-submit').prop('disabled', true).addClass('disabled'); 520 } else { 521 $('.form-submit').prop('disabled', false).removeClass('disabled');; 522 } 523 } 524 chkAgreement(); 525 $('.form-agreement').on('click', chkAgreement); 526 $('.form-submit').on('click', function (e) { 527 if ($('.form-agreement:not(:checked)').length) { 528 return false; 529 } 530 }); 531 } 532 533 // ãããã質åéé 534 if ($('dt.faq').length > 0) { 535 $('dd.answer').hide(); 536 $('dt.faq').on('click', function () { 537 //$('span.open').removeClass('open'); 538 $('dt.faq').not($(this)).find('span.open').removeClass('open'); 539 $(this).find('span').toggleClass('open'); 540 $('dt.faq').not($(this)).next('dd.answer').slideUp(); 541 $(this).next().slideToggle(); 542 }); 543 } 544 545 ////////////////////////////////////////////// 546 // 547 // ãã½ã³ã³ã¡ãã¥ã¼ã®éé 548 //
549 ////////////////////////////////////////////// 550 if ($('.pcMenuButton').length > 0) { 551 $('.pcMenuButton, .menuCloseButton').on('click', function () { 552 $('#pcMenuBox').toggle(); 553 $('html').toggleClass('hidden'); 554 }); 555 $('a').on('click', function () { 556 $('html').removeClass('hidden'); 557 $('#pcMenuBox').css('display', 'none'); 558 }); 559 } 560 561}); 562 563////////////////////////////////////////////// 564// 565// éµä¾¿çªå·å ¥åå¼ã³åºã(éµä¾¿çªå·1ã¤ç). 566// 567////////////////////////////////////////////// 568function fnCallAddressSingleZip(php_url, tagname1, input1, input2) { 569 zip1 = document.form1[tagname1].value; 570 571 if(zip1.length == 7) { 572 $.get( 573 php_url, 574 {zip1: zip1.slice(0, 3), zip2: zip1.slice(3), input1: input1, input2: input2}, 575 function(data) { 576 arrdata = data.split("|"); 577 if (arrdata.length > 1) { 578 fnPutAddress(input1, input2, arrdata[0], arrdata[1], arrdata[2]); 579 } else { 580 customAlert(data); 581 } 582 } 583 ); 584 } else { 585 customAlert("éµä¾¿çªå·ãæ£ããå ¥åãã¦ãã ããã"); 586 } 587} 588
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.