如果我移动一个小图像,多少 DOM 会被刷新?

发布于 2024-12-13 01:51:38 字数 384 浏览 0 评论 0原文

新手问题:我正在制作一个简单的html游戏。它由以下 DIV 层组成:

z=1: large image (framing image)
z=2: medium image covering z1 (houses, trees)
z=3: small image covering z2 (character)
z=4: semi transparent image covering z3 (foreground objects)
z=5: medium image covering z2 but not z3 (other objects on the scene)

如果我移动角色(z3 层),DOM 的哪些部分会刷新? 我知道这取决于浏览器,但是是否有最小化更改的通用规则?

Newbie question: I am making a simple html game. It consists of these DIV layers:

z=1: large image (framing image)
z=2: medium image covering z1 (houses, trees)
z=3: small image covering z2 (character)
z=4: semi transparent image covering z3 (foreground objects)
z=5: medium image covering z2 but not z3 (other objects on the scene)

If I move the character (layer z3), which parts of the DOM are refreshed?
I know it depends on the browser, but are there general rules for minimizing the changes?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

指尖微凉心微凉 2024-12-20 01:51:38

Paul Irish 制作了一个简短的视频,介绍如何通过 Chrome 的开发工具从 Chrome 中获取这些信息。它位于 http://paulirish.com/2011/viewing-chromes-paint- 虽然所有浏览器在重绘过程​​中发生的情况都会有所不同,但这

应该提供一些立足点。

Paul Irish did a quick video on how to get this information out of Chrome via its DevTools. It is located at http://paulirish.com/2011/viewing-chromes-paint-cycle/

While all browsers will vary somewhat in what goes on during repainting, this should offer a bit of a foothold.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文