PageSourceSearch

https://setsuzoku.nifty.com/docomo/js/docomoTopMain.js

js nifty.com collected 2026-10-01 07:34:09 UTC 1,709 bytes, 73 lines download raw bytes

1// スムーススクロール
2function smoothScroll(target, delay) {
3  let headerHeight = $('header').height();
4  $('html, body').animate({ scrollTop: target.offset().top - headerHeight }, delay);
5}
6$('a[href^="#"]').on('click', function (event) {
7  let target = $($(this).attr('href'));
8
9  if (target.length) {
10    event.preventDefault();
11    smoothScroll(target, 1000);
12  }
13});
14
15// ドロワーメニュー
16$(function () {
17  let spBtn = $('.docomoHeader_spMenu');
18  let menu = $('.docomoDrawerMenu');
19  let ovaerlay = $('.docomoOverlay');
20  let menuLink = $('.docomoDrawerMenu_link');
21  let drawerMenuBtn = $('.docomoDrawerMenu_btn');
22  const activeCls = 'is-active';
23
24  spBtn.on('click', function () {
25    $(this).toggleClass(activeCls);
26    ovaerlay.fadeToggle();
27    menu.toggleClass(activeCls);
28  });
29  
30
31  function menuClose() {
32    spBtn.removeClass(activeCls);
33    ovaerlay.fadeOut();
34    menu.removeClass(activeCls);
35  }
36
37  menuLink.on('click', function () {
38    menuClose()
39  });
40
41  drawerMenuBtn.on('click', function () {
42    menuClose()
43  });
44});
45
46// モーダル
47$(function () {
48  const body = $('body');
49  const modalLayer = $('.modalLayer');
50  let scrollTop;
51
52  $('.js-modal-open').click(function (e) {
53    e.preventDefault();
54    let target = $(this).data('modal-target');
55    scrollTop = $(window).scrollTop();
56    $('#' + target).fadeIn();
57    modalLayer.fadeIn();
58    body.addClass('scrollOff');
59    body.css({
60      top: -scrollTop
61    });
62  });
63
64  $('.js-modal-close').click(function () {
65    $('.modalItem').fadeOut();
66    modalLayer.fadeOut();
67    body.removeClass('scrollOff');
68    body.css({
69      top: ''
70    });
71    $('html, body').animate({ scrollTop: scrollTop }, 0);
72  });
73});

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.