PageSourceSearch

http://zjshibao.com/templates/tc/js/public.js

js zjshibao.com collected 2026-10-05 05:20:23 UTC 15,058 bytes, 538 lines download raw bytes

1
2$(document).ready(function(){
3	//通用切换
4	$('.tabSwitch').each(function(index, element) {
5		var obj = $(this);
6		obj.find('.tabTit').children().on('click tab',function(){
7			$(this).addClass('cur').siblings().removeClass('cur');
8			if (obj.find('.tabBox').children().eq($(this).index()).length > 0)
9				obj.find('.tabBox').children().hide().eq($(this).index()).show();
10			if (obj.find('.tabBox2').children().eq($(this).index()).length > 0)
11				obj.find('.tabBox2').children().hide().eq($(this).index()).show();
12			
13			return false;
14		});
15		obj.find('.tabTit .cur').trigger('tab');
16	});
17	$('.tabSwitchHover').each(function(index, element) {
18		var obj = $(this);
19		obj.find('.tabTit').children().on('mouseover tab',function(){
20			$(this).addClass('cur').siblings().removeClass('cur');
21			if (obj.find('.tabBox').children().eq($(this).index()).length > 0)
22				obj.find('.tabBox').children().hide().eq($(this).index()).show();
23			if (obj.find('.tabBox2').children().eq($(this).index()).length > 0)
24				obj.find('.tabBox2').children().hide().eq($(this).index()).show();
25			
26			//return false;
27		});
28		obj.find('.tabTit .cur').trigger('tab');
29	});
30});
31
32
33//通用弹出二维码
34	$("body").click(function(){
35	  $(".pop_box").hide();
36	});
37	$(".footer .foot-right .sweep #erweima").click(function(e){
38	  $(".pop_box").show();
39	  e.stopPropagation();
40	});
41
42
43$(document).ready(function() {
44	//  = 启用 Phone Nav = 
45	$("#mmenu").mmenu({
46		"header": true,
47		"iconPanels": true,
48		"navbar":{
49			"title": "世宝股份"
50		},
51		"navbars":{
52			"position": "top",
53			"content": [
54				"prev",
55                "title",
56                "close"
57			]
58		},
59		"offCanvas": {
60            "position": "top"
61       	},
62       	"footer": {
63       		"add":true,
64       		"content":"(c) 2018"
65       	},
66       	//autoHeight: true, 自动高度
67		//counters: true, //显示子栏目数目
68		"extensions" : [
69			/*"effect-zoom-menu",*/
70			"pageshadow",
71			"theme-white", 	//主题 theme-dark theme-black theme-white theme-light (default)
72			/*"effect-slide-listitems"*/
73		]
74	});
75	
76});
77
78$(document).ready(function() {
79	npos = $(window).scrollTop();
80	SW	=	$(window).width();
81	SH	=	$(window).height();		
82	IEFlag = (navigator.appVersion.indexOf("MSIE 7") > -1 || navigator.appVersion.indexOf("MSIE 8") > -1)?true:false;	
83	lnbFlag = false; var isrun = false;
84	
85	if ($('.banner img').length){
86		$(".banner img:eq(0)").one('load', function() {
87			isrun = true;
88			conInit();
89		}).each(function() {
90			if(this.complete){
91				$(this).load(); return false;
92			};
93		})
94	}else{
95		isrun = true;
96		conInit();
97	}
98});
99
100$(window).scroll(function() {			
101	npos = $(window).scrollTop();
102	SW	=	$(window).width();
103	SH	=	$(window).height();
104});//chd scroll
105
106$(window).resize(function(){
107	SW	=	$(window).width();
108	SH	=	$(window).height();		
109});//chd resize
110
111function conInit(){
112
113	var Actions,Event,total;
114	var cur				=	0;						
115	var ncur			=	0;						
116	var cTarget			=	$('body');
117	var item			=	[];
118	
119	if (cTarget.find('.maxbox').length == 0){
120		return false;
121	}
122
123
124	Init = {
125		_start:function(){
126
127			//$('#main_nav ul').css('margin-top',(($('#main_nav ul').height()/2)+120)*-1);
128			/*************
129			/	variable Add
130			*************/
131			total	=	cTarget.find('.maxbox').length;
132			//$('body,html').animate({scrollTop:0},300,'easeOutExpo')	
133			/*************
134			/	Event Add
135			*************/
136			
137
138
139			/*************
140			/	Item Add
141			*************/
142			var _i = 0;
143			cTarget.find('.maxbox').each(function($index){
144				var _t	=	$(this);
145				item[$index] = {
146					_data:_i,
147					_target:_t,
148					_moveFlag:true,
149					_play:function(_posY){
150						var target	=	this._target;
151						var f_t	=	target.position().top;
152						var f_b	=	f_t+600;
153						var p_y	=	_posY - f_t;
154						var d_y;
155						var target_w = target.width();
156						var target_h = target.height();
157						if(item[cur]._moveFlag){
158							var __i = 0;
159							target.find('.TweenToDelayUp').each(function(){
160								var _d = __i*0.15									
161								TweenMax.to($(this),0.8,{y:0,alpha:1,delay:_d,ease:Quad.easeOut});
162								__i++
163							});
164							
165							target.find('.TweenToDelayUpChildren').children().each(function(){
166								var _d = __i*0.15									
167								TweenMax.to($(this),0.8,{y:0,alpha:1,delay:_d,ease:Quad.easeOut});
168								__i++
169							});
170							
171							target.find('.TweenToDelayDown').each(function(){
172								var _d = __i*0.15									
173								TweenMax.to($(this),0.8,{y:0,alpha:1,delay:_d,ease:Quad.easeOut});
174								__i++
175							});
176							
177							target.find('.TweenToShow').each(function(){
178								var _d = __i*0.15;
179								TweenMax.to($(this),1.5,{y:0,alpha:1,delay:0,ease:Quad.easeOut});
180								__i++
181							});
182							
183							target.find('.TweenToShowChildren').children().each(function(){
184								var _d = __i*0.15;
185								TweenMax.to($(this),1.5,{y:0,alpha:1,delay:0,ease:Quad.easeOut});
186								__i++
187							});
188							
189							target.find('.TweenToDelayShow').each(function(){
190								var _d = __i*0.15;
191								TweenMax.to($(this),1.5,{y:0,alpha:1,delay:_d,ease:Quad.easeOut});
192								__i++
193							});
194							
195							target.find('.TweenToDelayShowChildren').children().each(function(){
196								var _d = __i*0.15;
197								TweenMax.to($(this),1.5,{y:0,alpha:1,delay:_d,ease:Quad.easeOut});
198								__i++
199							});
200							
201							target.find('.TweenToLeft, .TweenToRight').each(function(){
202								var _d = __i*0.15;
203								TweenMax.to($(this),1.5,{x:0,alpha:1,delay:0,ease:Quad.easeOut});
204								__i++
205							});
206							
207							target.find('.TweenToLeftChildren, .TweenToRightChildren').children().each(function(){
208								var _d = __i*0.15;
209								TweenMax.to($(this),1.5,{x:0,alpha:1,delay:0,ease:Quad.easeOut});
210								__i++
211							});
212							
213							target.find('.TweenToDelayLeftChildren, .TweenToDelayRightChildren').children().each(function(){
214								var _d = __i*0.4;//console.log(__i);
215								if (target.hasClass('oymc_div')){
216									if (__i % 2 > 0){
217										_d = old_d;
218									}
219								}else if (target.hasClass('TweenToUp')){
220									_d = 1.0;
221								}
222								TweenMax.to($(this),1.0,{x:0,alpha:1,delay:_d,ease:Quad.easeOut});
223								old_d = _d;
224								__i++
225							});
226
227							target.find('.TweenScale').each(function(){
228								var _d = __i*0.15;
229								TweenMax.to($(this),1.5,{scale:1.1,alpha:1,delay:0,ease:Quad.easeOut});
230								__i++
231							});
232
233
234						}
235						this._moveFlag = false;
236					},
237					_reset:function(){
238						var target	=	this._target;
239						var target_w = target.width();
240						var target_h = target.height();
241						this._moveFlag = true		
242							
243						target.find('.TweenToDelayUp').each(function(){
244							TweenMax.set($(this),{y:50,alpha:0});
245						});
246						
247						target.find('.TweenToDelayUpChildren').children().each(function(){
248							TweenMax.set($(this),{y:50,alpha:0});
249						});
250						
251						target.find('.TweenToDelayDown').each(function(){
252							TweenMax.set($(this),{y:-50,alpha:0});
253						});
254						
255						target.find('.TweenToShow, .TweenToDelayShow').each(function(){
256							TweenMax.set($(this),{alpha:0});
257						});
258						
259						target.find('.TweenToShowChildren, .TweenToDelayShowChildren').children().each(function(){
260							TweenMax.set($(this),{alpha:0});
261						});
262						
263						target.find('.TweenToLeft, .TweenToDelayLeft').each(function(){
264							TweenMax.set($(this),{x:200,alpha:0});
265						});
266						
267						target.find('.TweenToRight, .TweenToDelayRight').each(function(){
268							TweenMax.set($(this),{x:-200,alpha:0});
269						});
270						
271						target.find('.TweenToLeftChildren, .TweenToDelayLeftChildren').children().each(function(){
272							TweenMax.set($(this),{x:200,alpha:0});
273						});
274						
275						target.find('.TweenToRightChildren, .TweenToDelayRightChildren').children().each(function(){
276							TweenMax.set($(this),{x:-200,alpha:0});
277						});
278
279					}
280				}
281				item[$index]._reset();
282				_i++
283			});
284			
285			item[cur]._play(npos);						
286		}
287	}//init End
288
289	Actions = {
290		_pageMove:function(targetY){
291			$('html,body').stop().animate({scrollTop:targetY},1200)
292		},
293		_pageHandler:function(_posY){
294			item[cur]._play(_posY);
295			if(_posY == 0){
296				cTarget.find('.maxbox').each(function($index){
297					//item[$index]._reset();
298				});
299				//item[cur]._play(_posY);
300			}							
301		},
302		_pageResize:function(){
303			cTarget.find('.maxbox').each(function($index){
304				//item[$index]._reset();
305			});
306		}
307	}//Actions End
308
309	Event = {
310		_activeHandler:function(index){
311			var _mb = SH-(SH/2)
312			cTarget.find('.maxbox').each(function(vi){		
313				//console.log($(this).index('.maxbox'));
314				if(vi != total-1){
315					if(index >= $(this).offset().top-_mb && index <= $(this).next().offset().top-_mb){
316						cur = vi;					
317					}
318					if(index >= $(this).offset().top && index <= $(this).next().offset().top){
319						ncur = vi;
320					}
321				}else{
322					if(index >= $(this).offset().top-_mb){
323						cur = vi;
324					}
325					if(index >= $(this).offset().top){
326						ncur = vi;
327					}
328				}
329			});		
330		}
331	}//Event End
332
333	$(window).scroll(function() {	
334		npos = $(window).scrollTop();
335		SW	=	$(window).width();
336		SH	=	$(window).height();
337		Event._activeHandler(npos);
338		Actions._pageHandler(npos);
339	});//chd scroll
340
341	$(window).resize(function(){
342		SW	=	$(window).width();
343		SH	=	$(window).height();
344		Actions._pageResize();
345	});//chd resize
346	Init._start();
347	Event._activeHandler(npos);
348	Actions._pageHandler(npos);
349
350}//conInit End
351
352function CheckJobs(o){
353	var obj = $(o);
354	obj.find('[type="submit"]').attr('disabled',true);
355	
356	var msg = ''; layer.closeAll('tips');
357	var tid = obj.find('[name="tid"]').val(); 
358	var searKey = obj.find('[name="searKey"]').val();
359
360	
361	if (searKey.length < 1 || searKey.length > 100){
362		//msg = '请输入要搜索的职位\r';
363		//obj.find('[name="searKey"]').inputError({'err': msg, 'tips': 3, tipsMore: true});
364	}
365
366	if (msg.length){
367		obj.find('[type="submit"]').attr('disabled',false);
368		
369		return false;
370	}else{
371		$.ajax({
372			type: 'POST',
373			url: '/ajax',
374			dataType: 'json',
375			cache: false,
376			data: {tid:tid, searKey:searKey, location:location.href, act:obj.find('[name="act"]').val(), formhash:obj.find('[name="formhash"]').val()},
377			error: function(){
378				alert('出错了!');
379				return false;
380			},
381			success:function(json){
382				$('[name="formhash"]').val(json.formhash);
383				
384				if (json.errmsg == ''){
385					$('.tables_btn').html(json.msg);
386					$('.tables_con').html(json.msg2);
387					$('.phone_join').html(json.msg3);
388					$('.page_box').html(json.msg4);
389
390					$('.tabSwitch').each(function(index, element) {
391						var obj = $(this);
392						obj.find('.tabTit').children().on('click tab',function(){
393							$(this).addClass('cur').siblings().removeClass('cur');
394							if (obj.find('.tabBox').children().eq($(this).index()).length > 0)
395								obj.find('.tabBox').children().hide().eq($(this).index()).show();
396							if (obj.find('.tabBox2').children().eq($(this).index()).length > 0)
397								obj.find('.tabBox2').children().hide().eq($(this).index()).show();
398							
399							return false;
400						});
401						obj.find('.tabTit .cur').trigger('tab');
402					});
403				}else{
404					layer.alert(json.errmsg, {icon: 2});
405				}
406
407				obj.find('[type="submit"]').attr('disabled',false);
408			}
409		});
410	}
411	
412	return false;
413}
414
415function CheckContact(o){
416	var obj = $(o);
417	obj.find('[type="submit"]').attr('disabled',true);
418	
419	var msg = ''; layer.closeAll('tips');
420	var username = obj.find('[name="username"]').val(); 
421	var mobile = obj.find('[name="mobile"]').val();
422	var email = obj.find('[name="email"]').length?obj.find('[name="email"]').val():'';
423	var mess = obj.find('[name="mess"]').val();
424
425	
426	if (username.length < 1 || username.length > 100){
427		msg = '*请输入姓名\r';
428		obj.find('[name="username"]').inputError({'err': msg, 'tips': 3, tipsMore: true});
429	}
430	if (mobile.length <= 0){
431		msg = '*请输入手机号码\r';
432		obj.find('[name="mobile"]').inputError({'err': msg, 'tips': 3, tipsMore: true});
433	}else if (!CheckMobile(mobile)){
434		msg = '*请输入正确的手机号码\r';
435		obj.find('[name="mobile"]').inputError({'err': msg, 'tips': 3, tipsMore: true});
436	}
437	if (email.length > 0 && !CheckEmail(email)){
438		msg = '*请输入正确的电子邮箱\r';
439		obj.find('[name="email"]').inputError({'err': msg, 'tips': 3, tipsMore: true});
440	}
441
442	if (msg.length){
443		obj.find('[type="submit"]').attr('disabled',false);
444		
445		return false;
446	}else{
447		$.ajax({
448			type: 'POST',
449			url: '/ajax',
450			dataType: 'json',
451			cache: false,
452			data: {username:username, mobile:mobile, email:email, mess:mess, location:location.href, act:obj.find('[name="act"]').val(), formhash:obj.find('[name="formhash"]').val()},
453			error: function(){
454				alert('出错了!');
455				return false;
456			},
457			success:function(json){
458				$('[name="formhash"]').val(json.formhash);
459				
460				if (json.errmsg == ''){
461					layer.alert(json.msg, {icon: 1});
462					
463					o.reset();
464				}else{
465					layer.alert(json.errmsg, {icon: 2});
466				}
467
468				obj.find('[type="submit"]').attr('disabled',false);
469			}
470		});
471	}
472	
473	return false;
474}
475
476function CheckMobile(m){
477	var reg = /^(((13[0-9]{1})|(14[0-9]{1})|(17[0-9]{1})|(15[0-3]{1})|(15[5-9]{1})|(18[0-9]{1}))+\d{8})$/;
478	if (reg.test(m)) {
479		return true;
480	}
481	
482	return false;
483}
484
485function CheckEmail(m){
486	var reg = /^([a-z0-9+_]|\-|\.)+@(([a-z0-9_]|\-)+\.)+[a-z]{2,6}$/;
487	if (reg.test(m)) {
488		return true;
489	}
490	
491	return false;
492}
493
494
495jQuery.fn.extend({
496	inputError: function(options) {
497		return this.each(function() {
498			new jQuery.inputError(this, options);
499		});
500	}
501});
502jQuery.inputError = function(inputobj, options) {
503	var opt = options || {};
504	opt.class = opt.class || 'inputerror';
505	opt.err = opt.err || '';
506	opt.tips = opt.tips || 2;
507	opt.tipsMore = opt.tipsMore || false;
508
509	var obj = $(inputobj);
510	if (!obj.data('placeholder')){
511		obj.data('data-placeholder', obj.attr('placeholder'));
512		obj.attr('placeholder', opt.err?opt.err:obj.data('placeholder'));
513	}
514	obj.removeClass(opt.class).addClass(opt.class);
515	//小tips
516	layer.tips(opt.err, obj, {tips: [opt.tips, '#dd1721'], tipsMore: opt.tipsMore});
517
518	obj.unbind('focus').focus(function(event) {
519		$(this).removeClass(opt.class);
520		//obj.attr('placeholder', obj.data('placeholder'));
521	});
522	obj.unbind('blur').blur(function(event) {
523		$(this).removeClass(opt.class);
524		obj.attr('placeholder', obj.data('placeholder'));
525	});
526
527	if (obj.get(0).tagName!='INPUT' && obj.get(0).tagName!='TEXTAREA' && !obj.data('bindClick')){
528		obj.click(function(event) {
529			$(this).removeClass(opt.class);
530			obj.attr('placeholder', obj.data('placeholder'));
531		});
532		obj.children().click(function(){obj.click()});
533		obj.data('bindClick',true);
534	}
535};
536
537
538

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.