笙默考试管理系统-MyExamTest----codemirror(58)

笙默考试管理系统-MyExamTest----codemirror(58

目录

一、 笙默考试管理系统-MyExamTest----codemirror

二、 笙默考试管理系统-MyExamTest----codemirror

三、 笙默考试管理系统-MyExamTest----codemirror

四、 笙默考试管理系统-MyExamTest----codemirror

五、 笙默考试管理系统-MyExamTest----codemirror

    

  • 笙默考试管理系统-MyExamTest----codemirror

   function computedStyle(elt) {

        if (elt.currentStyle) return elt.currentStyle;

        return window.getComputedStyle(elt, null);

    }

    // Find the position of an element by following the offsetParent chain.

// If screen==true, it returns screen (rather than page) coordinates.

  • 笙默考试管理系统-MyExamTest----codemirror

    function eltOffset(node, screen) {

        var bod = node.ownerDocument.body;

        var x = 0, y = 0, skipBody = false;

        for (var n = node; n; n = n.offsetParent) {

            var ol = n.offsetLeft, ot = n.offsetTop;

            // Firefox reports weird inverted offsets when the body has a border.

            if (n == bod) { x += Math.abs(ol); y += Math.abs(ot); }

  • 笙默考试管理系统-MyExamTest----codemirror

            else { x += ol, y += ot; }

            if (screen && computedStyle(n).position == "fixed")

                skipBody = true;

        }

        var e = screen && !skipBody ? null : bod;

        for (var n = node.parentNode; n != e; n = n.parentNode)

            if (n.scrollLeft != null) { x -= n.scrollLeft; y -= n.scrollTop;}

  • 笙默考试管理系统-MyExamTest----codemirror

        return {left: x, top: y};

    }

    // Use the faster and saner getBoundingClientRect method when possible.

    if (document.documentElement.getBoundingClientRect != null) eltOffset = function(node, screen) {

        // Take the parts of bounding client rect that we are interested in so we are able to edit if need be,

        // since the returned value cannot be changed externally (they are kept in sync as the element moves within the page)

  • 笙默考试管理系统-MyExamTest----codemirror

        try { var box = node.getBoundingClientRect(); box = { top: box.top, left: box.left }; }

        catch(e) { box = {top: 0, left: 0}; }

        if (!screen) {

            // Get the toplevel scroll, working around browser differences.

            if (window.pageYOffset == null) {

                var t = document.documentElement || document.body.parentNode;

                if (t.scrollTop == null) t = document.body;

                box.top += t.scrollTop; box.left += t.scrollLeft;

            } else {

                box.top += window.pageYOffset; box.left += window.pageXOffset;

            }

        }

        return box;

    };

    // Get a node's text content.

    function eltText(node) {

        return node.textContent || node.innerText || node.nodeValue || "";

    }

    // Operations on {line, ch} objects.

    function posEq(a, b) {return a.line == b.line && a.ch == b.ch;}

    function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);}

    function copyPos(x) {return {line: x.line, ch: x.ch};}

  • 9
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

N201871643

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值