PageSourceSearch

http://www.chinaspirit.net.cn/template/pc/skin/js/common.js?t=1569372316

js chinaspirit.net.cn collected 2026-10-02 16:44:46 UTC 5,096 bytes, 102 lines download raw bytes

1 
2 function rechange(str){
3	c_str=str.replace(/document.write\("/g,"").replace(/"\);/g,"").replace(/\\\"/g,"\"").replace(/\\\'/g,"\'").replace(/\\\//g,"\/").replace(/\\\\/g,"\\");
4	return c_str;
5 }
6$(document).ready(function(){
7
8//搜索
9  $(".search-show").click(function(){  
10    $(".site-search,.navto-search").toggleClass("active");
11	$(".sbtn").toggleClass("fa-remove");
12  });
13$(".minnav").click(function(){
14    $(".minul").toggleClass("active");
15  });
16
17//首页幻灯
18if(isNeeded('#slide')){$(function(){(function($){$.fn.Slide=function(options){var defaults={item:"slide-item",nav:"slide-nav",nowClass:"nownav",loading:"slide-loading"},options=options||{};options=$.extend(defaults,options);var cont=$(this),item=cont.find("."+options.item),nav=cont.find("."+options.nav),curr=options.nowClass,len=item.length,width=item.width(),html="",index=order=0,timer=null,lw="-"+width+"px",rw=width+"px",newtimer,ld=cont.find("."+options.loading);item.each(function(i){$(this).css({left:i===index?0:(i>index?width+'px':'-'+width+'px')});html+='<a href="javascript:">'+(i+1)+'</a>';});$("#slide").hover(function(){$('#next').fadeIn();$('#prev').fadeIn();},function(){$('#next').fadeOut();$('#prev').fadeOut();});nav.html(html);var navitem=nav.find("a");navitem.eq(index).addClass(curr);function anim(index,dir){loading();if(order===len-1&&dir==='next'){item.eq(order).stop(true,false).animate({left:lw});item.eq(index).css({left:rw}).stop(true,false).animate({left:0});}else if(order===0&&dir==='prev'){item.eq(0).stop(true,false).animate({left:rw});item.eq(index).css({left:lw}).stop(true,false).animate({left:0});}else{item.eq(order).stop(true,false).animate({left:index>order?lw:rw});item.eq(index).stop(true,false).css({left:index>order?rw:lw}).animate({left:0});}
19order=index;navitem.removeClass(curr).eq(index).addClass(curr);}
20function next(){index=order>=len-1?0:order+1;_stop();ld.stop(true,true).animate({"width":0},0);anim(index,'next');timer=setInterval(next,5000);}
21function prev(){index=order<=0?len-1:order-1;_stop();ld.stop(true,true).animate({"width":0},0);anim(index,'prev');timer=setInterval(next,5000);}
22function auto(){loading();timer=setInterval(next,5000);}
23function _stop(){clearInterval(timer);}
24function loading(){ld.css({"height":"0","height":"5px","position":"absolute","left":"0","bottom":"0","background":"#FF4939","z-index":"10"});ld.animate({"width":"100%"},5000).animate({"width":0},0);}
25return this.each(function(){auto();navitem.hover(function(){_stop();var i=navitem.index(this);if(/nownav/.test($(this).attr('class'))){return false;}
26if(newtimer)clearTimeout(newtimer);newtimer=setTimeout(function(){_stop();ld.stop(true,true).animate({"width":0},0);anim(i,this);},250);},auto);$('#next').on('click',next);$('#prev').on('click',prev);});};})(jQuery);$("#slide").Slide();})}
27
28
29//点击展开查看详细介绍
30if(isNeeded('#countalldiv')){$(document).ready(function(){$(".intro_more").click(function(){if(isNeeded('.infotxt')){$(".infotxt").toggleClass("active");}else{$(".intro_art").toggleClass("active");}});});}
31//判断是不是有右边浮动广告
32if(isNeeded('.float_ad')){
33	$(function(){$(function() {
34	// 检查对象,#sidebar-tab是要随滚动条固定的ID,可根据需要更改
35		var offset = $('.float_ad').offset(); //1965		
36		fh_left=$('.fh_left').height();
37		fh_right=$('.fh_right').height();
38		if(fh_left>fh_right){
39		$(window).scroll(function () {	
40		// 检查对象的顶部是否在游览器可见的范围内		
41		var scrollTop = $(window).scrollTop();		
42			if (offset.top < scrollTop){
43				$('.float_ad').addClass('float_ad_fixed');
44				}else{
45					$('.float_ad').removeClass('float_ad_fixed');
46				}
47			});
48		}
49		});
50	})	
51}
52//回顶部
53$(window).scroll(function(){
54	//设置回顶部按钮的位置
55		if($(window).width()>1200){
56			cha_width=$(window).width()-1200;
57			width=cha_width/2-30;
58			$("#elevator_item").css("width",width+"px");
59		}
60		var scrolltop=$(this).scrollTop();
61		if(scrolltop>=200){
62			$("#elevator_item").fadeIn();
63		}else{
64			$("#elevator_item").fadeOut();
65		}		
66	});
67	$("#elevator").click(function(){
68		$("html,body").animate({scrollTop: 0}, 500);
69	});
70	$(".qr").hover(function(){
71		$(".qr-popup").fadeIn();
72	},function(){
73		$(".qr-popup").fadeOut();
74	});
75  
76});
77
78function isNeeded(selectors){
79    var selectors = (typeof selectors == 'string') ? [selectors] : selectors,
80        isNeeded;
81    for(var i=0;i<selectors.length;i++){
82        var selector = selectors[i];
83        if( $(selector).length > 0 ) { 
84            isNeeded = true; 
85            break; 
86        }
87    };
88    return isNeeded ;
89};
90function length() {
91    $(".cli").each(function() {
92        if ($(this).find("li").size() > 1) {
93            var mun = 0;
94            var $this = $(this);
95            console.log($this.find("li").size());
96            for (i = 1; i <= $this.find("li").size(); i++) {
97                mun = mun + $this.find("li").eq(i - 1).width() + 50;
98            }
99            $this.css("width", mun + 'px');
100        }
101    })
102}

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.