PageSourceSearch

https://www.matsumoto-ringyou.co.jp/common/themes/matsurin/js/common.js

js matsumoto-ringyou.co.jp collected 2026-10-06 07:18:07 UTC 2,500 bytes, 73 lines download raw bytes

1// JavaScript Document
2jQuery.noConflict();
3   (function($){
4//スマホでタッチイベント起動
5/* まず関数を定義 */
6var linkTouchStart = function(){
7    thisAnchor = $(this);
8    touchPos = thisAnchor.offset().top;
9    //タッチした瞬間のa要素の、上からの位置を取得。
10    moveCheck = function(){
11        nowPos = thisAnchor.offset().top;
12        if(touchPos == nowPos){
13            thisAnchor.addClass("hover");
14            //タッチした瞬間と0.1秒後のa要素の位置が変わっていなければ hover クラスを追加。
15            //リストなどでa要素が並んでいるときに、スクロールのためにタッチした部分にまでhover効果がついてしまうのを防止している。
16        }
17    }
18    setTimeout(moveCheck,100);
19    //0.1秒後にmoveCheck()を実行。
20}
21var linkTouchEnd = function(){
22    thisAnchor = $(this);
23    hoverRemove = function(){
24        thisAnchor.removeClass("hover");
25    }
26    setTimeout(hoverRemove,500);
27    //0.5秒後にhoverRemove()を実行。
28    //指を離した瞬間にhover効果を切るよりも、要素が変化した手応えを表現できる。
29}
30
31
32/* タッチイベントで上記の関数を呼び出す */
33$(document).on('touchstart mousedown','a',linkTouchStart);
34//a要素をタッチ、もしくはマウスクリックしたらlinkTouchStart()を実行。
35$(document).on('touchend mouseup','a',linkTouchEnd);
36//a要素から指を離す、もしくはクリックを終えたらlinkTouchEnd()を実行。
37
38
39$(function(){
40//drawer
41    $(".drawer").drawer();
42//drawer modelhouseの下層
43    // $(".toggle-menu .accordion").click(function(){
44    //     if($(this).children("ul").not(".hover")){
45    //         $(this).children("ul").addClass("hover");
46    //     }
47    // });
48    // $("li.back-menu").click(function(){
49    //     $(this).parent("ul").remove(".hover");
50    // });
51
52    $(".toggle-menu #gnav #accordion").click(function(){
53        $(this).children("ul").toggleClass("hover",true);
54    })
55    $('#gnav #accordion .back-menu').click(function(){
56        $("ul").remove(".hover");
57    })
58//ページトップへ
59    var pagetop = $('.pagetop');
60    $(window).scroll(function () {
61        if ($(this).scrollTop() > 100) {
62            pagetop.fadeIn();
63        } else {
64            pagetop.fadeOut();
65        }
66    });
67    pagetop.click(function () {
68        $('body, html').animate({ scrollTop: 0 }, 500);
69        return false;
70    });
71});
72
73})(jQuery);

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.