1$(function () { 2 CSS_formset(); 3 CSS_pagerRewrite(); 4 CSS_cateDivide(); 5 categoryShuffle(); 6 ellipsis(); 7 listSlick(); 8 gallerySlick(); 9 galleryBricks(); 10 createImagePopup(); 11 accordionViewmoreStyle(); 12 tab(); 13 bookmarkButton(); 14 changeInputByRdioButton();// maybe used 15 inputCalendar();// maybe used 16 inputImageFile(); 17 contactFixed();// maybe used 18 sideFixed(); 19 pageTop(); 20 selectDirectLink(); 21 detailTab(); 22 searchMenuSP(); 23 portalBaseSlider(); 24}); 25 26function detailTab() { 27 if (!$('[data-detail-tab-btn]')[0]) { return; } 28 $('[data-detail-tab-btn]').each(function () { 29 var $a = $(this).closest('a'); 30 var href = $a.attr('href').split('?')[0]; 31 var url = location.pathname; 32 var is_match = href.indexOf(url) != -1; 33 var is_top = url.match(/\/detail\/\d+?\/*?$/) != null; 34 var is_toppage = href.match(/\/detail\/\d+?\/*?$/) != null; 35 36 if (is_match && !is_top) { 37 $a.addClass('on'); 38 //$(this).addClass('on'); 39 } 40 if (is_top && is_toppage) { 41 $a.addClass('on'); 42 //$(this).addClass('on'); 43 } 44 }); 45} 46 47function portalBaseSlider() { 48 if (!$('[data-pb-slider]')[0]) { return; } 49 try { 50 51 // ãã 52 $('[data-pb-slider]').each(function () { 53 var $slider = $(this); 54 var $slick = $('[data-pb-slider-body]', $slider); 55 $('[data-pb-slider-body] img', $slider).each(function () { 56 var $button = $('<button type="button"></button>'); 57 $button.append($(this).clone()); 58 $('[data-pb-slider-nav]', $slider).append($button); 59 }); 60 $('[data-pb-slider-nav] button', $slider).on('click', function () { 61 var i = $('[data-pb-slider-nav] button', $slider).index(this); 62 $slick.slick('slickGoTo', i); 63 }); 64 65 // ã¡ã¤ã³ç»åã® src ã ã¼ããèæ¯ç¨ã«è¦ªã¸è»¢å + 極端ãªç¸¦é·ãå¤å® 66 $('.detail_slider_mask', $slider).each(function (idx) { 67 var $mask = $(this); 68 var src = $mask.find('img').attr('src'); 69 if (!src) { return; } 70 $mask.get(0).style.setProperty('--bg', 'url("' + src.replace(/"/g, '\\"') + '")'); 71 var $navBtn = $('[data-pb-slider-nav] button', $slider).eq(idx); 72 var probe = new Image(); 73 var apply = function () { 74 var w = probe.naturalWidth, h = probe.naturalHeight; 75 if (!w || !h) { return; } 76 if (h / w > 2) { 77 $mask.addClass('is-tall'); 78 $navBtn.addClass('is-tall'); 79 } else if (w / h > 2) { 80 $mask.addClass('is-wide'); 81 $navBtn.addClass('is-wide'); 82 } 83 }; 84 probe.onload = apply; 85 probe.src = src; 86 if (probe.complete && probe.naturalWidth) { apply(); } 87 }); 88 }); 89 90 // ã¹ã©ã¤ã 91 $('[data-pb-slider-body]').slick({ 92 dots: false, 93 arrows: false, 94 fade: true, 95 cssEase: 'linear', 96 slidesToShow: 1, 97 speed: 200, 98 infinite: true, 99 autoplay: true, 100 autoplaySpeed: 4000 101 }); 102 103 // èªåæ¡å¤§ 104 $(window).on('scroll', function () { 105 var $pb_slider = $('[data-pb-slider]'); 106 if ($(window).scrollTop() > 480 && !$pb_slider.hasClass('active')) { 107 $pb_slider.addClass('active'); 108 } else if ($(window).scrollTop() <= 480 && $pb_slider.hasClass('active')) { 109 $pb_slider.removeClass('active'); 110 } 111 }); 112 } catch (e) { console.log(e.message); } 113} 114 115function searchMenuSP() { 116 117 if (document.getElementById('search_f_menu') == null) { return; } 118 119 var $menu = $('#search_f_menu'); 120 var $searchItems = $('[data-search-items]'); 121 122 // open 123 $('[data-search-results-change]').on('click', function () { 124 $menu.addClass('active'); 125 $searchItems.addClass('active'); 126 }); 127 128 // close 129 $('[data-search-results-cancel]').on('click', function () { 130 $menu.removeClass('active'); 131 $searchItems.removeClass('active'); 132 }); 133 134 // submit 135 $('[data-search-results-submit]').on('click', function () { 136 $('form', $searchItems).submit(); 137 }); 138 139 if ($searchItems[0]) { 140 $(window).on('load resize', function () { 141 //--menu-padding: 12px; 142 //--menu-lead-width: 144px; 143 //--menu-btn-width: 88px; 144 //--menu-btn-height: 44px; 145 //--menu-close-width: 44px; 146 let menuStyle = getComputedStyle($menu[0]); 147 let menuVar_menuPadding = Number(menuStyle.getPropertyValue('--menu-padding').match(/\d+/)[0]);// pxã®ã¿å¯¾å¿ï¼rem,em,exãªã©ã«ã¯é対å¿ï¼ 148 let menuVar_btnHeight = Number(menuStyle.getPropertyValue('--menu-btn-height').match(/\d+/)[0]);// pxã®ã¿å¯¾å¿ï¼rem,em,exãªã©ã«ã¯é対å¿ï¼ 149 let menuHeightOnActive = menuVar_btnHeight + menuVar_menuPadding * 2;
150 let vh = window.innerHeight; 151 //let h = vh - $menu.outerHeight();// NOTE: ã¡ãã¥ã¼ã®é«ããå¯å¤ããªãå ´å 152 let h = vh - menuHeightOnActive;// NOTE: .activeæã«ãã¡ãã¥ã¼ã®é«ããå¯å¤ããå ´å 153 if (window.matchMedia("(max-width: 959px)").matches) { 154 $searchItems.outerHeight(h); 155 } else { 156 $searchItems.removeAttr('style'); 157 } 158 }); 159 } 160} 161 162/* slide */ 163function listSlick() { 164 if (!$('.list_slide')[0]) { return; } 165 try { 166 $('.list_slide').slick({ 167 dots: false, 168 arrows: true, 169 slidesToShow: 4, 170 speed: 200, 171 infinite: true, 172 autoplay: true, 173 autoplaySpeed: 2000, 174 responsive: [{ 175 breakpoint: 767, 176 settings: { 177 slidesToShow: 1, 178 } 179 }] 180 }); 181 } catch (e) { console.log(e.message); } 182} 183 184/* gallery slide */ 185function gallerySlick() { 186 var selector = 'detail_main_gallery_slick'; 187 if (document.getElementById(selector) == null) { return; } 188 try { 189 $('#' + selector).slick({ 190 191 dots: false, 192 arrows: false, 193 slidesToShow: 1, 194 speed: 200, 195 infinite: true, 196 autoplay: true, 197 autoplaySpeed: 2000, 198 }); 199 200 $('[data-gallery-thumb="' + selector + '"] li').on('click', function () { 201 var index = $('[data-gallery-thumb="' + selector + '"] li').index(this); 202 $('#' + selector).slick('slickGoTo', index); 203 }); 204 } catch (e) { console.log(e.message); } 205} 206 207/* gallery bricks */ 208function galleryBricks() { 209 const selector = '[data-pb-gallery-bricks]'; 210 if (!$(selector)[0]) { return; } 211 try { 212 $(selector).each(function () { 213 galleryModal($(this));// ã¢ã¼ãã«ã®å®è£ 214 var c = $(this).children().length; 215 $(this).children().each(function () { 216 let w = $(this).outerWidth(); 217 $(this).outerHeight(getRandomHeight(w, c)); 218 }); 219 }); 220 const sizes = [ 221 { columns: 3, gutter: 8 }, 222 { mq: '768px', columns: 4, gutter: 8 }, 223 { mq: '960px', columns: 4, gutter: 8 } 224 ]; 225 const instance = Bricks({ 226 container: selector, 227 packed: 'data-pb-gallery-bricks-item', 228 sizes: sizes 229 }); 230 instance.resize(true).pack(); 231 $(window).on('resize', function () { 232 $(selector).removeAttr('style'); 233 instance.pack() 234 }); 235 } catch (e) { console.log(e.message); } 236 237 function getRandomHeight(w, c) { 238 if (c < 5) { 239 // åçæ°ãå°ãªãå ´åã¯ä¸æ ¼å¥½ã«ãªãã®ã§ã¢ã¹ãã¯ãæ¯ãçµ±ä¸ãã 240 return 0.66 * w; 241 } 242 243 // ã©ã³ãã ãªé«ãï¼default 2:6-2:1ï¼ 244 let min = Math.ceil(2); 245 let max = Math.floor(6); 246 247 let rNum1 = Math.floor(Math.random() * (max - min) + min); 248 let rNum2 = Math.floor(Math.random() * (max - min) + min); 249 let rRatio = Math.floor((rNum1 / rNum2) * 100) / 100; 250 while (rRatio <= 0.5 || rRatio > 2) { 251 rNum1 = Math.floor(Math.random() * (max - min) + min); 252 rNum2 = Math.floor(Math.random() * (max - min) + min); 253 rRatio = Math.floor((rNum1 / rNum2) * 100) / 100; 254 } 255 return rRatio * w; 256 } 257} 258 259/* gallery modal */ 260function galleryModal(container_selector) { 261 $(container_selector).each(function () { 262 // magnificPopup modalã®å®è£ ï¼å¥ã®ã©ã¤ãã©ãªã¸å¤æ´ã®å ´åã¯ä»¥ä¸ãç·¨éï¼ 263 $(this).magnificPopup({ 264 type: 'image', 265 //closeOnContentClick: true, 266 //mainClass: 'mfp-img-mobile',// custum class name 267 //image: {verticalFit: true},// 1 image 268 delegate: 'a', 269 gallery: { enabled: true } 270 }); 271 }); 272} 273 274// data-pb-image-popupè¨å®è¦ç´ å imgã¿ã°ã«ã¢ã¼ãã«å®è£ 275function createImagePopup() { 276 const selector = '[data-pb-image-popup]'; 277 if (!$(selector)[0]) { return; } 278 $(selector).each(function () { 279 var $group = $(this); 280 $('img', $group).each(function () { 281 // aã¿ã°ãimgã®è¦ªã«ç¡ãå ´åä½ã 282 if ($(this).parent().prop('tagName').toLowerCase() != 'a') { 283 $(this).wrap('<a href="' + $(this).attr('src') + '"></a>'); 284 } 285 }); 286 // modalã®å®è£ 287 galleryModal($group); 288 }); 289} 290 291function selectDirectLink() { 292 if (!$('[data-select-direct-link]')[0]) { return; } 293 $('[data-select-direct-link]').on('change', function () { 294 $(this).closest('form').submit(); 295 }); 296} 297 298function ellipsis() { 299 300 if (!$('[data-ellipsis-pc]')[0]) { return; } 301 302 $(window).on('resize load', function () { 303 304 $('[data-ellipsis-pc]').each(function () { 305 306 var hellip = ($(this).attr('data-ellipsis-hellip') != '' ? $(this).attr('data-ellipsis-hellip') : '…'); 307 308 var pc_num = Number($(this).attr('data-ellipsis-pc')); 309 pc_num = (pc_num ? pc_num : 0); 310 311 var sp_num = Number($(this).attr('data-ellipsis-sp')); 312 sp_num = (sp_num ? sp_num : 0); 313 314 //sp 315 if (window.matchMedia('screen and (max-width:767px)').matches) { 316 317 if (sp_num != 0) { 318 $(this).html($(this).text().substr(0, sp_num) + hellip); 319 } 320 //pc 321 } else { 322 if (pc_num != 0) { 323 $(this).html($(this).text().substr(0, pc_num) + hellip); 324 } 325 } 326 }); 327 }); 328} 329 330//æåæ°ãã«ã¦ã³ããã
331function countString() { 332 333 if (!$('[data-count-str-length]')[0]) { return; } 334 335 $('[data-count-str-length]').each(function () { 336 337 //æå¤§æåæ° 338 $(this).data('defaultLength', Number($('[data-count-str-length] > span').text())); 339 340 //æåæ°ãå³ãããç®æãã»ãã 341 var id = '#' + $(this).data('count-str-length'); 342 343 //ãã¼ãæã®åæè¨å® 344 countStringInit($(id), $(this)); 345 346 $(id).on('keyup', countStringLength($(id))); 347 }); 348} 349 350//ãã¼ãæã®åæè¨å® 351function countStringInit($elm, note) { 352 353 var defaultLength = note.data('defaultLength'); 354 var text = $elm.val(); 355 356 var countNumber = defaultLength - text.length; 357 358 var countTextElem = note.children('span'); 359 countTextElem.text(countNumber); 360 361 var warring = 100; 362 if (countNumber < warring) { 363 364 countTextElem.css({ 'color': '#f73b1e', 'font-weight': 'bold' }); 365 366 if ($elm.hasClass('input_color_warrning')) { 367 $elm.removeClass('input_color_warrning'); 368 } 369 370 } else if (countNumber <= 0) { 371 372 $elm.addClass('input_color_warrning'); 373 countTextElem.css({ 'color': 'inherit', 'font-weight': 'inherit' }); 374 375 } else { 376 377 if ($elm.hasClass('input_color_warrning')) { 378 $elm.removeClass('input_color_warrning'); 379 } 380 countTextElem.css({ 'color': 'inherit', 'font-weight': 'inherit' }); 381 } 382} 383 384 385//æåæ°ãã«ã¦ã³ããã 386function countStringLength($elm) { 387 388 var v, old = $elm.val(); 389 390 return function () { 391 392 if (old != (v = $elm.val())) { 393 394 old = v; 395 396 var id = $(this).attr('id'); 397 var note = $('[data-count-str-length="' + id + '"]'); 398 var defaultLength = note.data('defaultLength'); 399 400 var text = $(this).val(); 401 var countNumber = defaultLength - text.length; 402 403 var countTextElem = note.children('span'); 404 countTextElem.text(countNumber); 405 406 var warring = 100; 407 if (countNumber < warring) { 408 409 countTextElem.css({ 'color': '#f73b1e', 'font-weight': 'bold' }); 410 411 if ($elm.hasClass('input_color_warrning')) { 412 $elm.removeClass('input_color_warrning'); 413 } 414 415 } else if (countNumber <= 0) { 416 417 $elm.addClass('input_color_warrning'); 418 419 countTextElem.css({ 'color': 'inherit', 'font-weight': 'inherit' }); 420 421 } else { 422 423 if ($elm.hasClass('input_color_warrning')) { 424 $elm.removeClass('input_color_warrning'); 425 } 426 countTextElem.css({ 'color': 'inherit', 'font-weight': 'inherit' }); 427 } 428 } 429 }; 430} 431 432function pageTop() { 433 434 $('#page_top').on('click', function () { 435 setTimeout(function () { 436 $('#page_top').blur(); 437 }, 200); 438 }); 439} 440 441$(function () { 442 443 resetAcc(); 444 445 $(window).on('resize', function () { 446 resetAcc(); 447 }); 448 449 $('.search_item_group__title.acc_btn').on('click', function () { 450 setTimeout(function () { resetAcc() }, 0); 451 }); 452 453 $('[data-accordion-open],[data-accordion-head]').on('click', function () { 454 let $group = $(this).closest('[data-accordion]'); 455 let $accText = $('[data-accordion-text]', $group); 456 let $accBtns = $('[data-accordion-open],[data-accordion-head]', $group); 457 let minHeight = window.matchMedia('screen and (max-width:767px)').matches ? 130 : 64;// SP : PC 458 let orgHeight = $accText.attr('data-default-height'); 459 $group.toggleClass('is--open'); 460 if ($group.hasClass('is--open')) { 461 // open 462 $accText.stop().animate({ height: orgHeight }, 200); 463 $accBtns.addClass('active'); 464 } else { 465 // close 466 $accText.stop().animate({ height: minHeight }, 200); 467 $accBtns.removeClass('active'); 468 } 469 }); 470 471 function resetAcc() { 472 $('[data-accordion]').each(function () { 473 let $group = $(this); 474 let $accText = $('[data-accordion-text]', $group); 475 let minHeight = window.matchMedia('screen and (max-width:767px)').matches ? 130 : 64;// SP : PC 476 let orgHeight = $accText.removeAttr('style').css({ height: 'auto' }).outerHeight(); 477 $accText.attr('data-default-height', orgHeight); 478 $accText.height(minHeight); 479 }); 480 } 481}) 482 483 484function accordionViewmoreStyle() { 485 if (!$('[data-viewmore]')[0]) { return; } 486 $('[data-viewmore-btn]').on('click', function () { 487 if (window.matchMedia('screen and (max-width:767px)').matches) { 488 if ($(this).hasClass('active')) { 489 $(this).removeClass('active'); 490 $(this).next('[data-viewmore-content]').stop().slideUp(400); 491 } else { 492 $(this).addClass('active'); 493 $(this).next('[data-viewmore-content]').stop().slideDown(400); 494 } 495 } 496 }); 497 $(window).on('load resize', function () { 498 if (!window.matchMedia('screen and (max-width:767px)').matches) { 499 $('[data-viewmore-btn]').removeClass('active'); 500 $('[data-viewmore-content]').removeAttr('style'); 501 } 502 }); 503} 504 505function tab() { 506 507 if (!$('.page_tab')[0]) { return; } 508 509 //init 510 $('.page_tab_content > div').hide(); 511 $('.page_tab a').each(function () { 512 513 if ($(this).hasClass('active')) { 514 515 var id = $(this).attr('href'); 516 $(id).show(); 517 } 518 }); 519 520 //event 521 $('.page_tab a').on('click', function () { 522 523 if ($(this).hasClass('disabled')) { 524 525 $('.page_tab_content > div').hide(); 526 var id = $(this).attr('href'); 527 $(id).show(); 528 529 $('.page_tab a').addClass('disabled'); 530 $(this).removeClass('disabled'); 531 $(this).addClass('active'); 532 } 533 534 return false;
535 }); 536} 537 538function bookmarkButton() { 539 if (!$('.btn_bookmark[onclick],.btn_bookmark[onClick]')[0]) { return; } 540 $('.btn_bookmark[onclick],.btn_bookmark[onClick]').on('click', function () { 541 var $btn = $(this); 542 $btn.addClass('active'); 543 setTimeout(function () { 544 $btn.removeClass('active'); 545 }, 250); 546 }); 547} 548 549function changeInputByRdioButton() { 550 551 if (!$('[data-change-input]')[0]) { return; } 552 553 //init 554 var $noChecked = $('[data-change-input-target]:not(:checked)'); 555 $noChecked.each(function () { 556 557 var target = $(this).attr('data-change-input-target'); 558 $('#' + target).hide(); 559 }); 560 561 //event 562 $('[data-change-input] input[type="radio"]').on('click', function () { 563 564 var target = $(this).attr('data-change-input-target'); 565 $('#' + target).show(); 566 567 $('[data-change-input-target]').each(function () { 568 569 if ($(this).prop('checked') === false) { 570 571 var target = $(this).attr('data-change-input-target'); 572 $('#' + target).hide(); 573 } 574 }); 575 }); 576} 577 578//calendarå ¥å 579function inputCalendar() { 580 581 if (!$('[data-calendar-id]')[0]) { return; } 582 583 $('input[readonly]').on('keydown', function (e) { 584 585 if ((e.which && e.which === 8) || (e.keyCode && e.keyCode === 8)) { 586 return false; 587 } 588 }); 589 590 $('[data-calendar-id]').each(function () { 591 592 //init 593 var myID = $(this).attr('data-calendar-id'); 594 var $input = $('[data-calendar-input="' + myID + '"]');//dummy text 595 var $input1 = $('[data-calendar-date="' + myID + '"]');//hidden date 596 var $input2 = $('[data-calendar-time="' + myID + '"]');//hidden time 597 598 //ããã¹ãå ¥åãç·¨éä¸è½ã«è¨å® 599 $input.attr('readonly', true); 600 601 //ã©ãã«ã使 602 inputCalendarCreateLabel($(this)); 603 604 //event 605 $('input[type="radio"]', $(this)).on('click', function () { 606 607 var value = $(this).val(); 608 var text = value.replace('ï½', ''); 609 text = text.replace('(', '|'); 610 text = text.replace(')', '|'); 611 612 var date = text.split('|'); 613 $input.val($(this).val());//dummy text 614 $input1.val(date[0]);//hidden date 615 $input2.val(date[2]);//hidden time 616 617 $input.trigger('blur'); 618 619 var name = $(this).attr("name"); 620 621 let modal = $.remodal.lookup[$('[data-remodal-id=' + name + ']').data('remodal')]; 622 modal.close(); 623 624 }); 625 }); 626} 627 628//ã©ãã«ã使 629function inputCalendarCreateLabel($calendar) { 630 631 var $clone = $('.input_calendar', $calendar).clone(); 632 $('td:not(:first-child),thead th:not(:first-child)', $clone).remove(); 633 var $label = $('<div class="input_calendar_label"></div>'); 634 $label.append($clone); 635 $('.input_calendar', $calendar).before($label); 636} 637 638function inputImageFile() { 639 if (!$('[data-input-file]')[0]) { return; } 640 $('[data-input-file] input[type="file"]').on('change', function (e) { 641 var reader = new FileReader(); 642 var $input = $(this); 643 var $img = $('img', $input.parent()); 644 reader.onload = function (reader_event) { 645 $img.attr('src', reader_event.target.result); 646 } 647 reader.readAsDataURL(e.target.files[0]); 648 }); 649} 650 651//css 652function CSS_pagerRewrite() { 653 654 if (!$('.page_pager')[0]) { return; } 655 656 $('.page_pager').each(function () { 657 658 var str = $(this).html(); 659 if (!str.match(/対象件æ°/)) { return true; } 660 661 str = str.explode('ã').join(''); 662 str = str.replace(/対象件æ°\((.*?)\)/, '<span class="page_pager_head">対象件æ°<em>($1)</em></span>'); 663 str = str.explode('<').join('<span class="page_pager_shortcut">'); 664 str = str.explode('>').join('</span>'); 665 str = str.explode('<b>').join('<b><span>'); 666 str = str.explode('</b>').join('</span></b>'); 667 668 $(this).html(str); 669 }); 670} 671 672function CSS_cateDivide() { 673 674 if ($('.topic_cate')[0]) { 675 $('.topic_cate').each(function () { 676 var $cate = $(this); 677 var text = $cate.text(); 678 var cates = text.split(/>|>|ï¼/); 679 $cate.empty(); 680 $.each(cates, function (i, cate) { 681 $cate.append('<span>' + cate + '</span>'); 682 }); 683 }); 684 } 685 686 if ($('.category_parts')[0]) { 687 $('.category_parts a').each(function () { 688 var $cate = $(this); 689 var text = $cate.text(); 690 var cates = text.split(/>|>|ï¼/); 691 $cate.empty(); 692 $.each(cates, function (i, cate) { 693 $cate.append('<span>' + cate + '</span>'); 694 }); 695 }); 696 } 697} 698 699function CSS_formset() { 700 if (!$('.form_support_wrap')[0]) return; 701 $('.form_support_wrap div').each(function () { 702 let $div = $(this); 703 if ($div.is('.form_support_wrap > div > div:first-child')) $div.addClass('formset__ttl'); 704 if ($div.is('.form_support_wrap > div > div:last-child')) $div.addClass('formset__input'); 705 if ($div.is('.form_support_wrap > div > div:only-child')) $div.addClass('formset__input'); 706 if ($div.is('.form_support_wrap > div')) $div.addClass('formset__item'); 707 }); 708} 709 710function categoryShuffle() { 711 712 if (!$('.list_category')[0]) { return; } 713 714 //get list 715 var arr = []; 716 $('.list_category').each(function (i) { 717 718 arr[i] = []; 719 $('li', $(this)).each(function () { 720 721 arr[i].push($(this).html()); 722 }); 723 arr[i].sort(function () { 724 return Math.random() - Math.random(); 725 }); 726 }); 727 728 //append list 729 $('.list_category ul').empty(); 730 $('.list_category').each(function (i) { 731 732 for (var n = 0; n < arr[i].length; n++) { 733 734 $('ul', $(this)).append('<li>' + arr[i][n] + '</li>'); 735 } 736 }); 737} 738 739function contactFixed() { 740 741 if (!$('.detail_header_func')[0]) { return; } 742 743 var $nav = $('.detail_header_func:eq(0)').clone(); 744 $('a', $nav).wrap('<div />'); 745 $nav.addClass('detail_header_func_fixed'); 746 $('.goto_pagetop').addClass('goto_pagetop_offset'); 747 $('body').append($nav); 748} 749 750function sideFixed() { 751 752 if (!$('.side_clinic')[0]) { return; } 753 var $side = $('.side_clinic:eq(0)'); 754 var $sideArea = $('#detail_side'); 755 756 var defaultSideTop = $sideArea.offset().top; 757 var endPointTop = 0; 758 759 $(window).on('load scroll resize', function () { 760 761 //get endPointTop 762 endPointTop = $sideArea.offset().top + $sideArea.height() - $side.height(); 763 764 if ($(this).scrollTop() > defaultSideTop && $(this).scrollTop() < endPointTop) { 765 console.log('fixed'); 766 $side.addClass('side_clinic_fixed'); 767 $side.removeClass('side_clinic_end'); 768 769 } else if ($(this).scrollTop() > defaultSideTop && $(this).scrollTop() >= endPointTop) { 770 console.log('end'); 771 $side.addClass('side_clinic_end'); 772 } else { 773 $side.removeClass('side_clinic_fixed'); 774 $side.removeClass('side_clinic_end'); 775 } 776 }); 777} 778 779/** remåä½ãpxåä½ã«å¤æãã **/ 780function convertRemToPx(rem) { 781 var fontSize = getComputedStyle(document.documentElement).fontSize; 782 return rem * parseFloat(fontSize); 783}
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.