RM.Web/Themes/Scripts/jquery.pullbox.js

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

(function ($) {
    $.fn.PullBox = function (options) {
        var defaults = {
            //最外层元素
            dv: '',
            //被选择对象以数组形式
            obj: '',
            //选中的样式
            selectClass: 'selected',
            //窗口宽度
            windowidth: document.documentElement.clientWidth,
            //窗口高度
            windowheight: document.documentElement.clientHeight,
            // 记录鼠标按下时的坐标
            downX: 0,
            downY: 0,
            // 记录鼠标抬起时候的坐标
            mouseX2: 0,
            mouseY2: 0,
            //是否全屏拉框
            Isscreen: true,
            //创建选择框DIV
            rect: $("<div id='rect'></div>")
        };
        var opts = $.extend({}, defaults, options);
        return this.each(function () {

            var J = $(this);
            //阻止mouseup后触发click事件
            var IsMove = false;
            if (opts.Isscreen) {
                $("body div").first().height(opts.windowheight);
                $("body div").first().width(opts.windowidth);
            }
            J.append(opts.rect);

            J.mousedown(function (event) {
                IsMove = false;
                down(event, opts);
                $(document).mousemove(function (event) {

                    IsMove = true;
                    move(event, opts);

                }).mouseup(function (event) {
                    up(event, opts);
                    $(document).unbind('mousemove').unbind('mouseup');

                });
            }).click(function (e) {
                //取消所有选择
                if (!IsMove) {
                    onselect(opts);
                };
                IsMove = false; //

            });

        });

后面还有 173 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。