PageSourceSearch

https://www.goo-net.com/usedcar/common_v2/js/detail_list_201308.js?171128

js goo-net.com collected 2026-10-01 10:30:27 UTC 15,200 bytes, 512 lines download raw bytes

1;(function(window, document, $, undefined){
2
3var $win = $(window);
4
5function reviewArea(){
6  var self = this;
7  $(function(){self.initialize();});
8}
9
10reviewArea.prototype = {
11  initialize: function(){
12    this.bindEvent();
13  },
14
15  bindEvent: function(){
16    $('.balloonWhiteOpen a').on("click", $.proxy(this.balloonOpen, this));
17  },
18
19  balloonOpen: function(e){
20    e.stopPropagation();
21    e.preventDefault();
22
23    // レビュー欄の吹き出しを開く
24    $(e.currentTarget).closest('div').find('.balloonWhiteInner').show();
25  }
26}
27
28/* 該当件数のカウンター クリアボタン 詳細条件を開くボタン*/
29
30function searchArea(){
31  var self = this;
32  $(function(){self.initialize();});
33}
34
35searchArea.prototype = {
36  initialize: function(){
37    this.$form = $(".box_searchCondition");
38    this.$balloon = $(".countBalloon");
39    this.$red_btn_search = $(".red_btn_search");
40
41    this.bindEvent();
42  },
43
44  bindEvent: function(){
45    this.$form
46      .find(":checkbox, select, :text").on("change", $.proxy( this.onChange, this ) ).end()
47      .find(".link_more a").on("click", $.proxy( this.onMore, this ) );
48
49		$(".stockRequestBtn").on("click", $.proxy( this.onChange, this ));
50  },
51
52  onMore: function(e) {
53    e.preventDefault();
54
55    var str = "もっと詳細な条件で絞り込む";
56    if(! this.$form.hasClass("open") ) str = "詳細条件を閉じる";
57
58    $(e.currentTarget).find("span").text(str);
59  },
60
61  onChange: function(e){
62    e.stopPropagation();
63
64    changeHiddenValue();
65    changeHiddenGrtValue();
66
67    // 物件数の取得api
68    var req = {type: "post", dataType: "json", data: {}}, param, self = this, num = 0;
69
70    // Domain chk
71    var domain = location.hostname;
72    
73    var ishttps = 'https:' == document.location.protocol ? true: false;
74    if(ishttps){
75      req.url = "https://" + domain + "/php/search_api/easysearch/search_count.php";
76    }else{
77      req.url = "http://" + domain + "/php/search_api/easysearch/search_count.php";
78    }
79
80    param = $(".hiddenparam").map(function(){
81      var $this = $(this), fn = $this.attr('name'), val = $this.val();
82
83      if(! fn || val == "") return;
84
85      req.data[ fn ] = val;
86      return [fn, val].join('=');
87    });
88
89    $.ajax(req).then(function(d){
90      num = d.total_count;
91      return self.showBalloon()
92    }).done(function(){
93      self.updateCount( num );
94    });
95
96    //検索ボタンを赤くする
97    this.$form.find(".submit_btn_01").removeClass("btn_black").addClass("btn_red");
98
99  },
100
101  showBalloon: function(){
102    return this.$balloon.fadeIn(200).promise();
103  },
104
105  updateCount: function( num ){
106    var self = this,
107        dest = num,
108        prev = this.getPrevCount(),
109        target = this.$balloon.find("span"),
110        red_btn_search = this.$red_btn_search.find("span");
111    this.$red_btn_search
112		.toggleClass("disabled_num_button", Number(dest) <= 0)
113		.attr("aria-disabled", Number(dest) <= 0 ? "true" : "false");
114    onUpd = function() {
115      var val;
116      prev += (dest - prev) * 0.2;
117      val = Math.round(prev);
118
119      target.text( self.insertComma(val) );
120      red_btn_search.text( self.insertComma(val) );
121      if (val === dest) { clearInterval(self.timerid); }
122    }
123
124    if (this.timerid) {
125      clearInterval(this.timerid);
126    }
127    this.timerid = setInterval(onUpd, 30);
128
129  },
130
131  getPrevCount: function(){
132    return Number( this.$balloon.find("span").text().replace(",", "") );
133  },
134
135  insertComma: function( num ){
136    return String( num ).replace( /(\d)(?=(\d\d\d)+(?!\d))/g, '$1,' );
137  }
138
139};
140
141/* ページトップへ戻る */
142
143function pageTop(){ this.initialize(); }
144
145pageTop.prototype = {
146  initialize: function(){
147    if( isIE6 ) return;
148    if ($(".btn_pagetop").length){
149        var btn = $(".btn_pagetop"),
150            prop1 = {position: "fixed", bottom: 10, right: 20},
151            prop2 = {position: "absolute"},
152            form = $('form'),
153            formOffset = form.offset().top,
154            offsetBtm = 30,
155            pos = {right: 30};
156
157        $.extend(prop2, pos);
158
159        btn.css(prop1);
160
161    $win.bind("scroll resize",function(){
162      var dv, dh, w = $win.width(), h = $win.height(),
163          lim = form.height() + formOffset - offsetBtm,
164          top = $win.scrollTop();
165
166      if(top > 600 && btn.css('display') === "none") btn.fadeIn();
167      else if (top < 600 && btn.css('display') !== "none") btn.fadeOut();
168
169      if((dv = top + h - lim) > 0) { pos.bottom = dv-offsetBtm; }
170      else { pos.bottom = offsetBtm; }
171      if(w > 1140) { pos.right = (w-960)/2-60; }
172      else { pos.right = 30; }
173
174      if(btn.css("bottom") != 30) btn.css(pos);
175
176    });
177    }
178  }
179}
180
181/* ついてくるナビの内容をスクロール量に応じて変える */
182
183function searchResult() {
184  $(window).on("load", $.proxy(this.initialize, this));
185}
186
187searchResult.prototype = {
188  initialize: function(){
189    this.$result = $(".box_item_detail");
190    this.$resultArea = $('#resultArea');
191    this.$body = $('body');
192
193    this.bindEvent();
194 },
195
196  bindEvent: function(){
197    //this.$result.find(".btn_addlist a").not(".done").on("click", $.proxy( this.onAddList, this) );
198
199    $win.on("scroll", $.proxy(this.onScroll, this));
200  },
201
202  onScroll: function(){
203    //スクロール量に応じてbodyにクラス付与する
204
205    var scrollY = $win.scrollTop(), offsetY = this.$resultArea.offset().top+41;
206
207    if(offsetY < scrollY) {
208      if(!this.$body.hasClass("both_fixed")) this.$body.addClass("both_fixed");
209    } else {
210      if(this.$body.hasClass("both_fixed")) this.$body.removeClass("both_fixed");
211    }
212  }
213}
214
215
216function Mockup() { $($.proxy(this.initialize, this)); }
217
218Mockup.prototype = {
219  initialize: function(){
220    this.$el = $('.box_item_detail');
221    this.bindEvent();
222  },
223
224  bindEvent: function(){
225    this.$el.find("input:checkbox").on("click", $.proxy(this.onCheck, this));
226  },
227
228  onCheck: function(e){
229
230    /* 結果チェック時に見出しに色づけ */
231
232    var color = "#f2f2f2", $target = $(e.currentTarget);
233    if($target.filter(":checked").size() > 0) color = "#ffdb70";
234    $target.closest(".heading").css({backgroundColor: color});
235
236
237  }
238}
239
240
241//
242// RUN
243//
244
245new reviewArea();
246new searchArea();
247new searchResult();
248new pageTop();
249
250new Mockup();
251
252
253})(window, document, jQuery);
254
255
256/* ANG_PRJ-2299 160412 */
257$(function(){
258	$(".terms a").click(function(){
259		if($(".box_searchCondition").css("display") == "none"){
260			$(".box_searchCondition").slideDown(500);
261			$(".terms a").text("絞り込み条件を閉じる");
262		}
263		else if($(".box_searchCondition").css("display") == "block"){
264			$(".box_searchCondition").slideUp(300);
265			setTimeout(function(){
266				$(".terms a").text("絞り込み条件を表示する");
267			},300);
268		}
269	});
270
271	if($(".terms").size() > 0){
272		//ソートバー追従
273		lpoSecondFloat();
274
275		//展開した場合
276		$(".terms a").click(function(){
277			setTimeout(function(){
278				if($(".box_searchCondition").css('display') == 'block'){
279					var scrollTitHeight = $("#scrollTit").height();
280					var resultTableHeight = $("#resultTable").height();
281					//登録台数バー追従
282					$(window).scroll(function(){
283						topFloat(scrollTitHeight,resultTableHeight);
284					});
285				
286					//ソートバー追従
287					$(window).scroll(function(){
288						secondFloat(scrollTitHeight,resultTableHeight);
289					});
290				}
291				else if($(".box_searchCondition").css('display') == 'none'){
292					lpoSecondFloat();
293				}
294			},320);
295		});
296	}
297	else if($("#scrollTit").size() > 0){
298		if($("#resultTable").size() == 0){
299			doFunc = $.noop;
300		}
301		else{
302			var scrollTitHeight = $("#scrollTit").height();
303			var resultTableHeight = $("#resultTable").height();
304			if ($(".wrapLineTit").size() > 0){
305				//登録台数バー追従 販売店ショールーム
306				$(window).scroll(function(){
307					topFloatShowroom(scrollTitHeight,resultTableHeight);
308				});
309				
310				//ソートバー追従 販売店ショールーム
311				$(window).scroll(function(){
312					secondFloat(scrollTitHeight,resultTableHeight);
313				});
314			} else {
315				//登録台数バー追従
316				$(window).scroll(function(){
317					topFloat(scrollTitHeight,resultTableHeight);
318				});
319				
320				//ソートバー追従
321				$(window).scroll(function(){
322					secondFloat(scrollTitHeight,resultTableHeight);
323				});
324			}
325		}
326	}
327	else if($("#scrollTit").size() == 0){
328		lpoSecondFloat();
329	}
330
331	//登録台数バー追従
332	function topFloat(s,r){
333		if ($(".scroolTop").length){
334			var endLine = $(".scroolTop").offset().top + $(".scroolTop").outerHeight(true) - 10 - s - r;
335			var scrollTitFloatLine = $("#scroll").offset().top;
336
337			if($(window).scrollTop() >= endLine){
338				$("#scrollTit").css({'position':'absolute'});
339			}
340			else if($(window).scrollTop() <= endLine && $(window).scrollTop() >= scrollTitFloatLine){
341				$("#scrollTit").css({'position':'','top':''});
342				$("#scrollTit").addClass("scrollBlock");
343				$(".box_roundGrayBottom").css('padding-top',s);
344			}
345			else if($(window).scrollTop() >= scrollTitFloatLine){
346				$("#scrollTit").addClass("scrollBlock");
347				$(".box_roundGrayBottom").css('padding-top',s);
348			}
349			else if($(window).scrollTop() <= scrollTitFloatLine){
350				$("#scrollTit").removeClass("scrollBlock");
351				$(".box_roundGrayBottom").css('padding-top','');
352			}
353		}
354	}
355
356	//登録台数バー追従 販売店ショールーム
357	function topFloatShowroom(s,r){
358		if ($(".scroolTop").length){
359			var endLine = $(".scroolTop").offset().top + $(".scroolTop").outerHeight(true) - 10 - s - r;
360			var Floatshowroom = $('#scrollTit');
361			var FloatshowroomTop = $('.box_searchCondition').offset().top;
362			
363			if($(window).scrollTop() >= endLine){
364				$("#scrollTit").css({'position':'absolute','top':endLine});
365			}
366			else if ($(window).scrollTop() <= endLine && $(window).scrollTop() >= FloatshowroomTop){
367				Floatshowroom.css({'position':'','top':''});
368				Floatshowroom.addClass('scrollBlock');
369				$(".box_roundGrayBottom").css('padding-top',s);
370			}
371			else if($(window).scrollTop() >= FloatshowroomTop){
372				Floatshowroom.addClass("scrollBlock");
373				$(".box_roundGrayBottom").css('padding-top',s);
374			}
375			else if ($(window).scrollTop() <= FloatshowroomTop){
376				Floatshowroom.removeClass('scrollBlock');
377				$(".box_roundGrayBottom").css('padding-top','');
378			}
379		}
380	}
381
382	//ソートバー追従
383	function secondFloat(s,r){
384		if ($(".scroolTop").length){
385			var endLine02 = $(".scroolTop").offset().top + $(".scroolTop").outerHeight(true) - 10 - r - s;
386			var resultTableFloatLine = $(".allCheckArea").offset().top + $(".allCheckArea").outerHeight(true);
387			var resultTableFloatLine02 = resultTableFloatLine + s;
388
389			if($(window).scrollTop() >= endLine02){
390				$("#resultTable").css({'position':'absolute','top':endLine02 + s - 1});
391			}
392			else if($(window).scrollTop() <= endLine02 && $(window).scrollTop() >= resultTableFloatLine02 - s - r){
393				$("#resultTable").css({'top':s - 1,'position':''});
394				$("#resultTable").addClass("scrollBlock");
395				$(".itemDetailArea").css('margin-top',r + 20);
396
397			}
398			else if($(window).scrollTop() >= resultTableFloatLine02 - s - r){
399				$("#resultTable").addClass("scrollBlock");
400				$("#resultTable").css('top',s - 1);
401				$(".itemDetailArea").css('margin-top',r + 20);
402			}
403			else if($(window).scrollTop() <= resultTableFloatLine02 - s){
404				$("#resultTable").removeClass("scrollBlock");
405				$("#resultTable").css('top','');
406				$(".itemDetailArea").css('margin-top','');
407			}
408		}
409	}
410
411	//LPページ専用
412	function lpoSecondFloat(){
413		if ($(".allCheckArea").length){
414			var resultTableHeight = $("#resultTable").height();
415			var floatLine01 = $(".allCheckArea").offset().top + $(".allCheckArea").outerHeight(true);
416			$(window).scroll(function(){
417				var endLine02 = $(".scroolTop").offset().top + $(".scroolTop").outerHeight(true) - 10 - resultTableHeight;
418
419				if($(window).scrollTop() >= endLine02){
420					$("#resultTable").css({'position':'absolute','top':endLine02});
421				}
422				else if($(window).scrollTop() <= endLine02 && $(window).scrollTop() >= floatLine01){
423					$("#resultTable").addClass("scrollBlock");
424					$("#resultTable").css({'top':'0','position':''});
425					$(".itemDetailArea").css('margin-top',resultTableHeight + 20);
426				}
427				else if($(window).scrollTop() >= floatLine01){
428					$("#resultTable").addClass("scrollBlock");
429					$("#resultTable").css('top','0');
430					$(".itemDetailArea").css('margin-top',resultTableHeight + 20);
431
432				}
433				else if($(window).scrollTop() <= floatLine01){
434					$("#resultTable").removeClass("scrollBlock");
435					$("#resultTable").css('top','');
436					$(".itemDetailArea").css('margin-top','');
437				}
438			});
439		}
440	}
441
442
443	//ANG_PRJ-2321 160603
444    var selectAction = function() {
445		if($(".kifirst span").text() == "都道府県を選択"){
446			$(".kisecond").addClass("no_select");
447			$(".kifirst").removeClass("no_select");
448
449			$(".kisecond span").text("市区町村を選択");
450			$(".kisecond").removeClass("no_select02");
451		}
452		else{
453			$(".kifirst").addClass("no_select");
454			$(".kisecond").removeClass("no_select");
455
456			if($(".kisecond span").text() != "市区町村を選択"){
457				$(".kisecond").addClass("no_select02");
458			}
459			else{
460				$(".kisecond").removeClass("no_select02");
461			}
462		}
463
464		var $setElm = $('.h_dl_01 dd span');
465		var cutFigure = '8';
466		var afterTxt = '…';
467	
468		$setElm.each(function(){
469			var textLength = $(this).text().length;
470			var textTrim = $(this).text().substr(0,(cutFigure));
471	
472			if(cutFigure < textLength) {
473				$(this).html(textTrim + afterTxt).css({visibility:'visible'});
474			} else if(cutFigure >= textLength) {
475				$(this).css({visibility:'visible'});
476			}
477		});
478    };
479    setInterval(selectAction, 100);
480});
481
482// 来店予約カレンダーのレイアウト
483function editReservCal(trId) {
484
485    var trBlock = $('#tr_' + trId);
486    var conv = trBlock.nextAll('.section_conv');
487    var btn = conv.find('#reservation_' + trId);
488    var cal =conv.find('.reserveCal');
489    var calTop = cal.find('.calTop');
490    var calMain = cal.find('.calMain');
491
492    // カレンダー全体の位置
493    var calPosTop = btn.position().top + btn.outerHeight() - (calTop.outerHeight() / 2);
494    cal.css('top', calPosTop + 'px');
495
496    // 吹き出しの三角の位置
497    // ①クリックされたボタンの左端
498    var buttonSepL = conv.position().left + btn.position().left;
499
500    // ②カレンダーの左端
501    var calL = conv.position().left + conv.outerWidth() - cal.outerWidth();
502
503    // ③ボタンの幅
504    var buttonSepW = btn.outerWidth();
505
506    // ④三角の幅
507    var calTopW = calTop.outerWidth();
508
509    // 三角の位置 = (①ー②)+(③÷2)ー(④÷2)
510    var calTopL = (buttonSepL - calL) + (buttonSepW / 2) - (calTopW / 2);
511    calTop.css('margin-left', calTopL + 'px');
512}

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.