PageSourceSearch

http://0pz2.cn/bocweb/js/bocfe.js?v=v11

js 0pz2.cn collected 2026-10-09 04:28:58 UTC 5,112 bytes, 178 lines download raw bytes

1// 默认obj为执行元素
2
3// HOVER
4	// 默认样式 .h , 默认Hover样式 .hover
5	// 自定义HOVER可使用 Hover(obj, classname)
6$(function(){
7	$(".h").hover(function(){
8		$(this).addClass("hover")
9	}, function(){
10		$(this).removeClass("hover")
11	})
12})
13function Hover(obj, classname) {
14	obj.hover(function(){
15		$(this).addClass(classname)
16	}, function(){
17		$(this).removeClass(classname)
18	})
19}
20
21// TAB
22	// 默认焦点样式 .cur
23	// 为防止xp系统opacity可能出现的锯齿或边缘模糊, 默认.tabbox效果.show() / .hide()
24	// 拓展.tabbox成opacity, 需在.tabbox上加上 data-effect="true"
25function Tab(tabBtn, tabBox) {
26	var tabbl = true;
27	tabBtn.eq(0).addClass("cur")
28	tabBox.eq(0).show()
29	tabBtn.click(function(){
30        var n = $(this).index();
31        $(this).addClass("cur").siblings().removeClass("cur")
32        if(tabBox.attr("data-effect") == "true"){
33        	if(!tabbl){
34        		return
35        	}
36        	tabbl = false;
37        	tabBox.eq(n).stop().fadeIn(800).siblings().stop().fadeOut(800, function(){
38        		tabbl = true;
39        	})
40        }else{
41        	tabBox.eq(n).show().siblings().hide()
42        }
43    })
44}
45
46// 图片全屏 / 图片充满整个父级
47	// 默认box自带loading背景图
48	// 默认obj hide
49function FullBg(box, obj){
50	box.css("background", "none")
51	obj.eq(0).stop().fadeIn(1000)
52	function resizeBg() {
53		obj.removeClass("w-f").removeClass("h-f").css("margin", 0)
54		var boxR = box.outerWidth() / box.outerHeight(),
55			objR = obj.width() / obj.height();
56		if( objR < boxR ) {
57		    obj.addClass('w-f').css("margin-top", -(obj.height() - box.outerHeight()) / 2);
58		}else{
59		    obj.addClass('h-f').css("margin-left", -(obj.width() - box.outerWidth()) / 2);
60		}
61	}
62	$(window).resize(resizeBg).trigger("resize");
63}
64// 视频全屏 / 视频充满整个父级 (video获取宽高有问题)
65function videoFull(obj, width, height){
66	var $video = obj
67	function resizeBg() {
68		$video.attr("width", "").attr("height", "").attr("style", "")
69		var boxR = $('.top-video').outerWidth() / $('.top-video').outerHeight(),
70			objR = width / height;
71
72		if( objR < boxR ) {
73			$video.attr("width", "100%")
74			var videoHeight = $video.width() / objR
75			var top = - (videoHeight - $('.top-video').outerHeight()) / 2 > 0 ? 0 : - (videoHeight - $('.top-video').outerHeight()) / 2
76			$video.css("margin-top", top);
77		}else{
78			$video.attr("height", "100%")
79			var videoWidth = $video.height() * objR
80			var left = - (videoWidth - $('.top-video').outerWidth()) / 2 > 0 ? 0 : - (videoWidth - $('.top-video').outerWidth()) / 2
81		    $video.css("margin-left", left);
82		}
83	}
84	$(window).resize(resizeBg).trigger("resize");
85}
86
87
88// 标签进场效果
89	// 用于多平级标签依次载入 默认标签具有position属性及opacuty: 0;
90	// direction 从哪个方向进入
91	// distance  进入到指定距离
92	// number    平级标签的个数
93	// time      进场动画的时间
94	// delay     下一标签的延迟
95	// callback  回调函数
96function Enter(obj, direction, distance, number, time, delay, callback) {
97	// 从左往右,distance > 0
98	if(direction == "left"){
99		obj.stop().animate({
100			left : distance,
101			opacity : 1
102		}, time)
103		setTimeout(function(){
104			if(obj.next().index() != -1){
105				Enter(obj.next(), direction, distance, number, time, delay, callback)
106			}else{
107				setTimeout(function(){
108					callback = callback || function(){};
109	    			callback ();
110	    			return
111				}, time - delay)
112			}
113		}, delay)
114	}
115	// 从上往下,distance > 0
116	if(direction == "top"){
117		obj.stop().animate({
118			top : distance,
119			opacity : 1
120		}, time)
121		setTimeout(function(){
122			if(obj.next().index() != -1){
123				Enter(obj.next(), direction, distance, number, time, delay, callback)
124			}else{
125				setTimeout(function(){
126					callback = callback || function(){};
127	    			callback ();
128	    			return
129				}, time - delay)
130			}
131		}, delay)
132	}
133	// CSS3 X位移
134	if(direction == "X"){
135		obj.stop().transition({
136			x : distance,
137			opacity : 1
138		}, time)
139		setTimeout(function(){
140			if(obj.next().index() != -1){
141				Enter(obj.next(), direction, distance, number, time, delay, callback)
142			}else{
143				setTimeout(function(){
144					callback = callback || function(){};
145	    			callback ();
146	    			return
147				}, time - delay)
148			}
149		}, delay)
150	}
151	// CSS3 y位移
152	if(direction == "Y"){
153		obj.stop().transition({
154			y : distance,
155			opacity : 1
156		}, time)
157		setTimeout(function(){
158			if(obj.next().index() != -1){
159				Enter(obj.next(), direction, distance, number, time, delay, callback)
160			}else{
161				setTimeout(function(){
162					callback = callback || function(){};
163	    			callback ();
164	    			return
165				}, time - delay)
166			}
167		}, delay)
168	}
169}
170
171// 图片加载 调用方法
172// _PreLoadImg([
173	// 图片路径(数组形式)
174// ],function(){
175
176// })
177function _PreLoadImg(b,e){var c=0,a={},d=0;for(src in b){d++}for(src in b){a[src]=new Image();a[src].onload=function(){if(++c>=d){e(a)}};a[src].src=b[src]}};
178

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.