PageSourceSearch

https://data.travelchinaguide.com/js/v1/function/slider/init.js

js travelchinaguide.com collected 2026-10-02 02:45:38 UTC 2,571 bytes, 81 lines download raw bytes

1/*
2	pic slider v1.0 by richard.
3*/
4var gslider={
5	isAutoHeight:false,
6	isScroll:true,
7	lastIndex:0,
8	index:0,
9	second:4,
10	sl:function(){return $('.g_sliderV2');},
11	init:function(){ 
12		if(this.sl().size()>0){
13			this.sl().find('img').css({'opacity':0,'z-index':1,'position':'absolute'});
14			this.sl().find('img').eq(0).css({'opacity':1,'z-index':2});
15			
16			if(this.sl().hasClass("autoHeight")){
17				gslider.isAutoHeight = true;
18			}
19			
20			if(gslider.isAutoHeight && this.sl().find('img').eq(0).height()>0){
21				this.sl().height(this.sl().find('img').eq(0).height());
22			}
23			
24			this.sl().hover(function(){gslider.isScroll=false;},function(){gslider.isScroll=true;});
25			
26			//indicator
27			var indi=$('.g_sliderV2_indicator').size();
28			if(indi>0){this.sl().hover(function(){gslider.isScroll=false;},function(){gslider.isScroll=true;});
29				var t='';
30				for(var i=0;i<this.sl().find('img').size();i++){
31					t+='<li idx="'+i+'" class="'+(i==0?'current':'')+'"><a></a></li>';
32				}
33				this.sl().append('<ol class="g_sliderV2_indicator_ol">'+t+'</ol>'); 
34				$('.g_sliderV2_indicator_ol li').click(function(){
35					gslider.index=$(this).attr('idx');
36					$('.g_sliderV2_indicator_ol li').removeClass('current');	
37					$('.g_sliderV2_indicator_ol li').eq(gslider.index).addClass('current');
38					gslider.show();
39				});
40			}
41			var timeInterval=this.sl().attr('timeInterval')||this.second*500;
42			//alert(timeInterval);
43			setInterval(function(){ 
44				if(gslider.isScroll){
45					++gslider.index;
46					gslider.show();
47				}
48			},timeInterval);
49		}
50	},
51	show:function(){
52			if(gslider.index>this.sl().find('img').size()-1)gslider.index=0;
53			if(gslider.index<0)gslider.index=this.size-1;
54			
55			if(gslider.isAutoHeight && this.sl().find('img').eq(0).height()>0){
56				this.sl().height(this.sl().find('img').eq(0).height());
57			}
58	
59			//过渡及显示
60			this.sl().find('img').eq(gslider.lastIndex).css({'z-index':1}).animate({'opacity':0},500);
61			this.sl().find('img').eq(gslider.index).css({'z-index':2}).animate({'opacity':1},500); 
62			
63			//intro
64			var intro=$('.g_sliderV2_intro');
65			if(intro.size()>0){
66				//console.log(gslider.index);
67				intro.find('li').hide();
68				intro.find('li').eq(gslider.index).show(); 
69			}
70			//indicator
71			var indi=$('.g_sliderV2_indicator_ol li');
72			if(indi.size()>0){ 
73				//console.log(gslider.index);
74				indi.removeClass('current');	
75				indi.eq(gslider.index).addClass('current');
76			}
77			
78			gslider.lastIndex=gslider.index;
79	}
80};
81gslider.init();

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.