PageSourceSearch

https://21tian.net/template/zvis_xm_160918/deancss/js/nv1.js

js 21tian.net collected 2026-09-24 09:47:14 UTC 1,607 bytes, 49 lines download raw bytes

1// JavaScript Document
2//导航固定
3	var FixedBox=function(el){
4		this.element=el;
5		this.BoxY=getXY(this.element).y;
6	}
7	FixedBox.prototype={
8		setCss:function(){
9			var windowST=(document.compatMode && document.compatMode!="CSS1Compat")? document.body.scrollTop:document.documentElement.scrollTop||window.pageYOffset;
10			if(windowST>this.BoxY){
11				this.element.style.cssText="position:fixed; top:0; z-index:10; opacity:0.9; ";
12			}else{
13				this.element.style.cssText="";
14			}
15		}
16	};
17	//添加事件
18	function addEvent(elm, evType, fn, useCapture) {
19		if (elm.addEventListener) {
20			elm.addEventListener(evType, fn, useCapture);
21		return true;
22		}else if (elm.attachEvent) {
23			var r = elm.attachEvent('on' + evType, fn);
24			return r;
25		}
26		else {
27			elm['on' + evType] = fn;
28		}
29	}
30	//获取元素的XY坐标;
31	function getXY(el) {
32        return document.documentElement.getBoundingClientRect && (function() {//取元素坐标,如元素或其上层元素设置position relative
33            var pos = el.getBoundingClientRect();
34            return { x: pos.left + document.documentElement.scrollLeft, y: pos.top + document.documentElement.scrollTop };
35        })() || (function() {
36            var _x = 0, _y = 0;
37            do {
38                _x += el.offsetLeft;
39                _y += el.offsetTop;
40            } while (el = el.offsetParent);
41            return { x: _x, y: _y };
42        })();
43    }
44	//实例化;
45	var divA=new FixedBox(document.getElementById("deanheader"));
46   	addEvent(window,"scroll",function(){
47		divA.setCss();
48	});
49	

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.