Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我喜欢在更改值以防止闪烁时停止渲染指定的 dom 元素。这可能吗 ?我可以使用 html2canvas 创建一个屏幕截图并在我更改 DOM 时显示它,但在我看来这有点矫枉过正。
分离元素,更改它,然后重新连接它。
function makeChanges(elem,changes) { var p = elem.parentNode, n = elem.nextSibling; p.removeChild(elem); changes(elem); // changes is a function containing the changing of values p.insertBefore(elem,n); }