PageSourceSearch

https://www.horipro-international.com/wp_horipro/wp-content/themes/horipro-international/assets/js/gnav.js

js horipro-international.com collected 2026-10-02 08:43:52 UTC 3,175 bytes, 87 lines download raw bytes

1$(function() {
2    // URLの取得
3    var url = location.href
4    // パスの取得
5    var path = location.pathname
6    // パラメーターの取得
7    var param = location.search
8    // ページ内アンカーの取得
9    var anc = location.hash
10    var gnav = $('.gnav_pc');
11    if (url == "http://www.horipro-international.com/"){
12    //if (url == "http://localhost:3000/"){
13        gnav.hide();
14        //スクロールが100に達したらボタン表示
15        $(window).scroll(function () {
16            if ($(this).scrollTop() > 100) {
17                gnav.fadeIn(500);
18            } else {
19                gnav.fadeOut(500);
20            }
21        });
22    }else{
23        gnav.show();
24    }
25});
26
27$(function() {
28    //翻訳した場合の処理(翻訳バーの高さだけ下にずらす)
29    translateBarAttachment();
30    //翻訳した場合の処理(翻訳バーの高さだけ下にずらす)
31    var mo = new MutationObserver(function(mutationRecords) {
32        translateBarAttachment();
33    });
34
35    //styleの監視
36    var options = {
37        attributes: true,
38        attributeFilter: ["class", "style"]
39    };
40
41    mo.observe(document.body, options);
42    //監視オプションの作成
43
44});
45
46//翻訳した場合の処理(翻訳バーの高さだけ下にずらす)
47function translateBarAttachment() {
48    var $navbar = $(".gnav_pc");
49    var $body = $("body");
50    if($body.offset().top > 0){
51        $navbar.css({
52            "top": "40px"
53        }); //翻訳バーの高さだけ下にずらす
54    }else if($body.offset().top == 0){
55        $navbar.css({
56            "top": "0"
57        });
58    }
59}
60
61//ドロップダウンの設定を関数でまとめる
62function mediaQueriesWin(){
63  var width = $(window).width();
64  if(width <= 768) {//横幅が768px以下の場合
65    $(".has-child>span").off('click'); //has-childクラスがついたaタグのonイベントを複数登録を避ける為offにして一旦初期状態へ
66    $(".has-child>span").on('click', function() {//has-childクラスがついたaタグをクリックしたら
67      var parentElem =  $(this).parent();// aタグから見た親要素の<li>を取得し
68      $(parentElem).toggleClass('active');//矢印方向を変えるためのクラス名を付与して
69      $(parentElem).children('ul').stop().slideToggle(500);//liの子要素のスライドを開閉させる※数字が大きくなるほどゆっくり開く
70      return false;//リンクの無効化
71    });
72  }else{//横幅が768px以上の場合
73    $(".has-child").off('click');//has-childクラスがついたaタグのonイベントをoff(無効)にし
74    $(".has-child").removeClass('active');//activeクラスを削除
75    $('.has-child').children('ul').css("display","");//スライドトグルで動作したdisplayも無効化にする
76  }
77}
78
79// ページがリサイズされたら動かしたい場合の記述
80$(window).resize(function() {
81  mediaQueriesWin();/* ドロップダウンの関数を呼ぶ*/
82});
83
84// ページが読み込まれたらすぐに動かしたい場合の記述
85$(window).on('load',function(){
86  mediaQueriesWin();/* ドロップダウンの関数を呼ぶ*/
87});

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.