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

2024-01-01 21:30:56

笙默考试管理系统-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};}

文章来源:https://blog.csdn.net/N201871643/article/details/135328355
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。