PageSourceSearch

https://instagrammers-gourmet.com/js/front.js

js instagrammers-gourmet.com collected 2026-10-07 06:20:29 UTC 7,573 bytes, 229 lines download raw bytes

1$(function(){
2	/*----------- 共通 -----------*/
3	var fadeSec = 300; //スピード
4	
5	/*----------- スムーズスクロール -----------*/
6    //ページトップ
7    $('.pagetop a').click(function(){
8        var speed = 500;
9        var href= $(this).attr("href");
10        var target = $(href == "#" || href == "" ? 'html' : href);
11        var position = target.offset().top;
12        $("html, body").animate({scrollTop:position}, speed, "swing");
13        return false;
14    });
15    
16	/*----------- ページトップの出現制御 -----------*/
17	var startPos = 0;
18	$(window).scroll(function(){
19		var currentPos = $(this).scrollTop();
20		if (currentPos > startPos) {
21			if($(window).scrollTop() >= 200) {
22				$(".pagetop").removeClass("pagetopShow");
23			}
24		} else {
25			$(".pagetop").addClass("pagetopShow");
26		}
27		startPos = currentPos;
28		
29		scrollHeight = $(document).height();
30		scrollPosition = $(window).height() + $(window).scrollTop();
31		scrollPresent = scrollHeight - scrollPosition;
32
33		if (scrollPresent < 100) {
34			$(".pagetop").removeClass("pagetopShow");
35		}
36	});
37	
38	/*----------- 絞り込み検索 -----------*/
39    if($(".narrowingSearchBtn").length){
40        $(document).on('click touchend','.narrowingSearchBtn a',function(){
41            event.preventDefault();
42
43            if ($(".narrowingSearch").css('display') == 'none') {
44                $(".narrowingSearch").fadeIn(fadeSec);
45                $("body").addClass("bodyfixed");
46            }
47
48            //ヘッダーメニューとヘッダー検索を閉じる
49            $("#gnav").removeClass("open");
50            $("#siteHeader .searchArea").removeClass("open");
51
52            return false;
53        });
54        
55        $(document).on('click touchend','.narrowingSearch .closeBtn a',function(){
56            event.preventDefault();
57
58            if ($(".narrowingSearch").css('display') == 'block') {
59                $(".narrowingSearch").fadeOut(fadeSec);
60                $("body").removeClass("bodyfixed");
61            }
62
63            return false;
64        });
65
66        // ポップアップ以外の箇所をクリックした時も閉じる
67        $(document).on('click touchend', function(event) {
68            if (!$(event.target).closest('.narrowingSearchCon').length) {
69                $(".narrowingSearch").fadeOut(fadeSec);
70                $("body").removeClass("bodyfixed");
71            }		
72        });
73    }
74	
75	/*----------- ヘッダー開閉 -----------*/
76    //spメニュー開閉
77    if($(".spMenu").length){
78        /*-- ヘッダーメニュー開閉 --*/
79        $(document).on('click touchend','.spMenu a',function(){
80            $(this).children("span").toggleClass("close");
81            $("#gnav").toggleClass("open");
82            $("#siteHeader .searchArea").removeClass("open");
83            return false
84         });
85    }
86
87    //ヘッダー検索開閉
88    if($(".searchArea").length){
89        //ヘッダー検索閉じる時のアクション
90        function searchMenuHide(){
91            $("#siteHeader .searchArea").removeClass("open");
92        }
93
94        $(document).on('click touchend','.searchMenu a',function(){
95            if ($("#siteHeader .searchArea").css('display') == 'block') {
96                searchMenuHide();
97            } else{
98                //ヘッダーメニューを開く
99                $("#gnav").removeClass("open");
100                $("#siteHeader .searchArea").addClass("open");
101                $(".spMenu a span").removeClass("close");
102            }
103            return false
104        });
105
106        // ポップアップ以外の箇所をクリックした時も閉じる
107        $(document).on('click touchend', function(event) {
108            if (!$(event.target).closest('#siteHeader .searchArea, .searchMenu a, #gnav, .spMenu a').length) {
109                searchMenuHide();
110                $("#gnav").removeClass("open");
111                $(".spMenu a span").removeClass("close");
112            }		
113        });
114    }
115    
116	/*----------- ソート -----------*/
117    if($(".sort").length){
118        $(document).on('click touchend','.sort .select a',function(){
119            if ($(".sort ul").css('display') == 'block') {
120                $(".sort ul").hide();
121            } else{
122                $(".sort ul").show();
123            }
124            return false
125        });
126
127        // ポップアップ以外の箇所をクリックした時も閉じる
128        $(document).on('click touchend', function(event) {
129            if (!$(event.target).closest('.sort .select a').length) {
130                $(".sort ul").hide();
131            }		
132        });
133    }
134    
135    /*----------- 文字数カット -----------*/
136    if($("ul.instaList").length){
137        $("ul.instaList").each(function () {
138            setMoreLink3($(this));
139        });
140    }
141
142    //カテゴリ 芸能人詳細
143    if($("#userGenre").length){
144        var limiH = 80; //制限する高さ
145        var afterTxt = '<p class="moreLink"><a href="#">もっと見る</a></p>';
145 // 文字カット後に表示するテキスト
146        var genreH = $(this).height();
147        if(genreH > limiH){
148            $("#userGenre").children("ul.genreList").after(afterTxt).css({visibility:'visible',height:'5em'});
149        }
150
151        //続きを見るを押した時のアクション
152        $(document).on('click touchend','#userGenre .moreLink',function(){
153            $(this).prev("ul.genreList").css({height:'auto'});
154            $(this).hide();
155            return false;
156        });
157    }
158
159    /*----------- 文字数カット -----------*/
160    if(window.matchMedia( "(max-width: 768px)" ).matches) {
161        if($(".instaList2").length){
162            var masonry = new Macy({
163                container: '#macy',
164                trueOrder: false,
165                waitForImages: false,
166                useOwnImageLoader: false,
167                margin: {
168                    x: 15,
169                    y: 15
170                },
171                columns: 6,
172                breakAt: {
173                    2000: {columns: 4},
174                    769: {columns: 2}
175                }
176            });
177        }
178    }
179	
180	/*----------- スライダー -----------*/
181	/*$('.single-item').slick({
182        accessibility:true,
183        cssEase: 'ease',
184        dots: true,
185        dotsClass: 'dot-class',
186        draggable: true,
187        fade: false,
188        arrows: false,
189        infinite: false,
190        initialSlide: 0,
191        slidesToShow: 1,
192        slidesToScroll: 1,
193        swipe: true,
194        vertical: false,
195	});*/
196
197});
198
199function setMoreLink3 (element) {
200
201    var limiH = 110; //制限する高さ
202    var afterTxt = '<a href="#" class="moreLink3">…続きを見る</a>'; // 文字カット後に表示するテキスト
203
204    element.find('li .txtArea .commentCon').each(function() {
205        var commentH = $(this).height();
206        if(commentH > limiH){
207            $(this).after(afterTxt).css({visibility:'visible',height:'7.7em'});
208        }
209    });
210
211    // 続きを見るを押した時のアクション
212    element.find('li .txtArea .moreLink3').on('click touchend', function(){
213        $(this).prev(".commentCon").css({height:'auto'});
214        $(this).hide();
215        return false;
216    });
217
218    //画像を押した時のアクション
219    element.find("li .photoArea").on('click touchend', function(event){
220        var morejg =  $(this).next(".txtArea").children(".comment").children(".moreLink3");
221        if(morejg.length){
222            $(this).next(".txtArea").children(".comment").children(".commentCon").css({height:'auto'});
223            morejg.hide();
224        }
225    });
226
227}
228
229

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.