PageSourceSearch

https://www.bjbus.com/home/js/js.js

js bjbus.com collected 2026-10-02 04:10:06 UTC 11,408 bytes, 350 lines download raw bytes

1/// <reference path="~/js/jquery-1.9.1.min.js" />
2function getParam() {
3	var url = location.search; 
4	var theRequest = new Object();
5	if (url.indexOf("?") != -1) {
6	var str = url.substr(1);
7	strs = str.split("&");
8	for(var i = 0; i < strs.length; i ++) {
9	theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
10	}
11	}
12	return theRequest;
13}
14
15$(function(){
16	
17	$(".text-cont .self-btn").click(function(){
18		$(".self-info-box,.full_overlay").fadeIn()
19	})
20	
21	$(".self-info-box .close,.full_overlay").click(function(){
22		$(".self-info-box,.full_overlay").fadeOut()
23	})
24	
25	 $(".self-info-box .table .text").focus(function(){
26            var txt_value =  $(this).val();
27            if(txt_value==this.defaultValue){
28                $(this).val("");
29				$(this).removeClass("on")
30            } 
31      }).blur(function(){
32              var txt_value = $(this).val();
33            if(txt_value==""){
34                $(this).val(this.defaultValue);
35				$(this).addClass("on")
36            } 
37      })
38	
39	$(".realtime_list li.realtime_prat3 section ul li:nth-child(3n-1)").addClass('mg');
40	$(".realtime_list li.realtime_prat4 section ul li:nth-child(3n-1)").addClass('mg');
41	$(".realtime_list li.realtime_prat7 section ul li:nth-child(3n-1)").addClass('mg');
42	$(".investment_property section ul li:nth-child(3n-1)").addClass('mg');
43	$(".passenger_video section ul li:nth-child(3n-1)").addClass('mg');
44	$(".inv_media_resources .inv_ma_fd ul li:nth-child(3n-1)").addClass('mg');
45	$(".passenger_video_warp section ul li:nth-child(3n-1)").removeClass('mg');
46	$(".passenger_video_warp section ul li:nth-child(4n)").addClass('mg');
47	
48	$(".trip_prat ul li:nth-child(3n-1)").addClass('mg');
49	
50	$(".cultures_list li.prat3 ul li:nth-child(2n+1)").addClass('even');
51	$(".notice_list li:nth-child(3n+1)").addClass('even');
52	$(".notice_list li:last").addClass('last');
53	//$(".philosophy_list ul li:nth-child(3n)").addClass('mg');
54	$(".cultures_list li.prat3 ul li:nth-child(4n)").addClass('mg');
55	$(".realtime_list li.realtime_prat5 section ul li:last").addClass('last');
56	$(".inv_media_price table tr th:last").addClass('last');
57	$(".trip_prat:last").addClass('last');
58	$(".realtime_list li.realtime_prat6 section ul li:odd").addClass('odd');
59	$(".longtrip_cont section ul li:odd").addClass('odd');
60	$(".cultures_list li.prat1 ul:odd").addClass('odd');
61	
62	$(".cultures_list li.prat1 .buses_list ul:odd").removeClass('odd');
63	
64	$('.rechargepoints_mn').each(function() {
65        $(this).find(".table:odd").addClass('odd');
66    });
67	
68	$(".realtimeBus_tab li").each(function(index) {
69		$(this).on('click',function(){
70			$(this).addClass("on").siblings().removeClass("on");
71			$(".realtimeBus_cont").hide();
72			$(".realtimeBus_cont").eq(index).show();
73		}) 
74    });
75	$(".realtimeBus_tab li:eq(0)").click();
76	
77	var getTheParam=getParam()["action"];
78	if(getTheParam==1){
79		$(".realtimeBus_tab li").eq(0).click();
80	}else if(getTheParam==2){
81		$(".realtimeBus_tab li").eq(1).click();
82	}else if(getTheParam==3){
83		$(".realtimeBus_tab li").eq(2).click();
84	}
85	
86	function side_search_bus_types()
87	{
88		window.location("");
89	}
90	
91	$('.footer .select dt').click(function() {
92		var $this = $(this)
93		if($this.next('dd').is(':hidden')) {
94			$this.siblings('dd').show();
95		} else {
96			$this.siblings('dd').hide();
97		}
98		return false;
99	});
100	$('.footer .select dd a').click(function() {
101		var $this = $(this);
102		$(this).parent().parent().prev().trigger('click');
103	});
104	$(document).click(function() {
105		$('.footer .select dd').hide();
106	});
107	
108	$('.calculator_hd ul li .select_box .title').click(function () {
109	    var $this = $(this)
110
111	    if ($this.next('.options').is(':hidden')) {
112	        $this.next('.options').show().parents('li').siblings('li').find('.options').hide();
113	    } else {
114	        $this.next('.options').hide();
115	    }
116
117	    return false;
118	});
119
120	$('.calculator_hd ul li .select_box .options li').click(function () {
121	    var $this = $(this);
122	    $(this).parent().parent().prev().find('.t').html($(this).find('p').html()).css('color', '');
123	    $(this).parent().parent().prev().trigger('click');
124	});
125
126	$(document).click(function () {
127	    $('.calculator_hd ul li .select_box .options').hide();
128	    $('.calculator_hd ul li .select_box').parents('.temp_zindex').removeClass('temp_zindex');
129	});
130	$('.calculator_wrap .part2 a').click(function () {
131	    $(this).addClass('on').siblings().removeClass('on');
132	})
133
134	$('.calculator_wrap .part4 li .title').click(function () {
135	    $(this).parent('li').addClass('on').siblings('li').removeClass('on');
136	})
137
138	//高度计算
139	$(window).resize(function(){
140	var wheight=$(".w").width(),//获取当前内容区宽度
141		 aheight=$(".cultures_list li.prat2 ul").width(),
142		 sth=1280,//设计稿画布宽度
143		 ath=960,
144		 bth=2620,
145		 winh=$(window).width();
146		 if(winh>=768)
147		 {
148			//$(".philosophy_list ul li img").height(Math.floor((wheight/sth)*307));
149			$(".cultures_list li.prat3 ul li > img").height(Math.floor((wheight/ath)*270));
150			$(".cultures_list li.prat2 ul li > img").height(Math.floor((aheight/bth)*400));
151			
152		 }
153		 $('.buses_decade').width(wheight-60)
154		 if(winh<768)
155		 {
156			 
157		}
158	
159	})
160	$(window).resize();
161	//end
162
163	$('.nav li dl').each(function(i) {
164        $(this).find('dd:last').addClass('last')
165    });
166
167//无图图像
168var nullimg='images/error.png';
169function lod(t){
170	t.onerror = null;
171	t.src=nullimg
172}
173$(document).ready(function(){
174	$("img").each(function(){
175		if($(this).attr("src")=="")
176		{
177			$(this).attr({"src":nullimg})
178		}
179	})
180})
181
182var nullimgs='../images/error.png';
183function errp(t){
184	t.onerror = null;
185	t.src=nullimgs
186}
187$(document).ready(function(){
188	$("img").each(function(){
189		if($(this).attr("src")=="")
190		{
191			$(this).attr({"src":nullimgs})
192		}
193	})
194})
195//end	
196})
197
198
199
200
201/*打印标记*/
202function doPrint() {
203	
204bdhtml=window.document.body.innerHTML;
205sprnstr="<!--startprint-->";
206eprnstr="<!--endprint-->";
207prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
208prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
209OpenWindow = window.open("");  
210OpenWindow.document.write("<!DOCTYPE HTML><HTML><HEAD><meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/><TITLE>打印页<\/TITLE><link href=\"../css\/style.css\" rel=\"stylesheet\" type=\"text\/css\" \/><\/HEAD><BODY><div id=\"printbox\" class=\"news_cont\" ><\/div><\/BODY><\/HTML>"); 
211OpenWindow.document.getElementById("printbox").innerHTML=prnhtml;  
212OpenWindow.document.close(); 
213OpenWindow.print();  
214}
215
216//内容区 字体字号 
217$(document).ready(function(){
218	$('.fontsize i').click(function () {
219        var index = jQuery(this).index();
220        jQuery(this).addClass('on').siblings().removeClass('on');
221        if (index == 0) {
222            $('.article_cont').css('font-size', '14px');
223				$('.article_cont').css('line-height', '24px');
224			}
225			else if (index == 1) {
226				$('.article_cont').css('font-size', '16px');
227				$('.article_cont').css('line-height', '26px');
228			}
229			else {
230				$('.article_cont').css('font-size', '16px');
231				$('.article_cont').css('line-height', '28px');
232        }
233    }).first().trigger('click');
234})
235
236
237
238
239
240
241
242
243
244
245
246var isSupportTouch = !!('ontouchend' in document) || navigator.userAgent.indexOf('Windows Phone') > 0;
247
248(function ($) {
249
250
251
252    $(document).ready(function () {
253       
254        $('.member_btn').click(function () {
255            $('.full_overlay').fadeTo(300, .61);
256            $('.member_pop').fadeIn();
257
258            editPopResize();
259        });
260        $('.full_overlay').click(function () {
261            $('.full_overlay, .member_pop,.public_total_pop').fadeOut();
262        })
263        $('.mailbox_pop .close_btn').click(function () {
264            $('.full_overlay, .member_pop').fadeOut();
265        });
266        
267    });
268
269})(jQuery);
270
271//如果弹出框内的内容有变动时,调用该方法,让弹出框始终居中。
272function editPopResize() {
273    var ep_v = '.public_total_pop, .mailbox_po',                             // 创建显示的编辑弹出层为变量
274        _document = 'html',
275        _window = 'body',
276        blank = 40;                                                 // 为弹出框上下留出 20 像素
277
278    $(ep_v).height($(ep_v).children('.inner').outerHeight(true));
279
280    var ep_v_h = $(ep_v).outerHeight() + blank,
281        ep_v_w = $(ep_v).outerWidth();
282
283    // 先让 body 的高度自动
284    $(_window).css('height', 'auto');
285
286    // 判断 body 的高度是否高过弹出框的高度或宽度
287    if ($(_window).height() > ep_v_h + blank || $(window).width() > $(ep_v).width()) {
288
289        // 判断 弹出框 的 高度 与 宽度 是否小于 body 的高度与宽度 
290        if (ep_v_h + blank < $(window).height() && $(ep_v).width() < $(window).width()) {
291            // 先将弹出框 对于窗口居中
292            $(ep_v).css({ position: 'fixed', top: '50%', left: '50%', marginTop: -(ep_v_h - blank) / 2, marginLeft: -ep_v_w / 2 });
293        } else {
294            // 如果 弹出框 的 高度 与 宽度 大于 body 的高度与宽度 
295
296            // 将卷去的高度 加上窗口的高度 加上 弹出框的减去窗口的高度除2
297            var total_h = $(window).scrollTop() + $(window).height() + (ep_v_h - $(window).height()) / 2;
298
299            // 判断弹出框的宽度是否大于窗口的宽度
300            if ($(ep_v).width() > $(window).width()) {
301                $(ep_v).css({ position: 'absolute', left: 0, marginLeft: ($('.wrap:eq(0)').width() - $(ep_v).width()) / 2 });
302            } else if ($(ep_v).width() < $(window).width() && ep_v_h < $(window).height()) {
303                $(ep_v).css({ position: 'fixed', left: '50%', marginLeft: -ep_v_w / 2 });
304            }
305
306            // 判断弹出框的高度是否大于窗口的高度
307            if (total_h > $(_window).height()) {
308                $(ep_v).css({ position: 'absolute', top: $(window).scrollTop(), marginTop: ($(window).height() - ep_v_h) / 2 + ($(_window).height() - total_h - 20), left: '50%', marginLeft: -($(ep_v).width() / 2) });
309            } else {
310                $(ep_v).css({ position: 'absolute', top: $(window).scrollTop(), marginTop: ($(window).height() - ep_v_h) / 2, left: '50%', marginLeft: -($(ep_v).width() / 2) });
311            }
312        }
313    } else {
314        // 如果body的高度小于弹出框的高 那么body就要被赋一个高
315        $(_window).height(ep_v_h + blank);
316        $(ep_v).css({ position: 'absolute', top: 0, marginTop: 20 });
317    }
318
319    //alert($(ep_v).offset().top)
320    // 判断弹出框的高是否大于窗口的高度并且 弹出框的高度减去窗口的高度还大于卷去的值
321    if (ep_v_h > $(window).height() && (ep_v_h - $(window).height()) / 2 > $(window).scrollTop()) {
322        $(ep_v).css({ position: 'absolute', top: 0, marginTop: 20 });
323    }
324
325    // 最后再 判断一次 第一次判断的值
326    if ($(ep_v).width() < $(window).width() && ep_v_h < $(window).height()) {
327
328        $(ep_v).css({ position: 'fixed', top: '50%', left: '50%', marginTop: -(ep_v_h - blank) / 2, marginLeft: -ep_v_w / 2 });
329    }
330
331    $(window).resize(function () {
332        editPopResize();
333    });
334}
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350

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.