多单位版国产化地质资料管理系统
zhai
2025-12-13 fc0cc9fff4b4cbdc7cbb52b4a96c947530fcbba0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
 
 
!(function (global, $, factory) {
 
    typeof exports == "object" && typeof module != "undefined" ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.CustomResize = factory());
})(this, jQuery, function () {
 
    var CustomResize = function (options) {
        if (!(this instanceof CustomResize)) {
            console.log("CustomResize 是一个构造函数,应该用new关键字调用");
            return;
        }
 
        var _DEFALUTS_ = {
            "id": "",  //必填,如果是id就写#id,如果是class名,就写.class
            "index":"", //如果class有好几个,需要确定某一个
            "fun":function(){ 
            },
            "height":"100%",
            "time":"100",
            "needFirstLoadFun":true //有的时候位置不对,不需要加载false
        }
        $.extend(true, _DEFALUTS_, options || {});
 
       
        function AutoScroll(){
 
            var reheight=_DEFALUTS_.fun&&_DEFALUTS_.fun();
            var _body;
            if(_DEFALUTS_.index!=""){
              
                _body= $(_DEFALUTS_.id).eq(_DEFALUTS_.index);
            }
            else{
                _body= $(_DEFALUTS_.id);
            }
 
            _body.height(reheight||_DEFALUTS_.height)
               
              
        }
 
        this.resizeFun= AutoScroll;
        var _this=this;
 
        $(window).resize(function () { 
            var handleResize = function () {
 
                // The timer kid
                if (_this.kid) {
                    window.clearTimeout(_this.kid);
                    _this.kid = null;
                }
    
                _this.kid = window.setTimeout(function () {
    
                 
                    _this.resizeFun();
    
                }, _DEFALUTS_.time);
            };
    
            handleResize();
        
        });
 
        _DEFALUTS_.needFirstLoadFun && this.resizeFun();
    }
 
    return CustomResize;
 
})