We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e021855 commit eacfa4aCopy full SHA for eacfa4a
22 Three.js优化之OffscreenCanvas与WebWorker.md
@@ -513,7 +513,32 @@ if ( state !== STATE.NONE ) {
513
514
515
516
+**除了模拟出 DOM 元素的各种事件之外,还需要模拟出其他一些内容:**
517
+
518
+> 你可以先想一下常见 DOM 元素还有哪些常用的属性或方法?
519
520
+1. event.preventDefault、event.stopPropagation:事件冒泡相关设置
521
+2. focus():设置 DOM 元素为当前焦点
522
+3. clientWidth、clientHeight:对象原始宽高
523
+4. getBoundingClientRect():获取元素显示大小、相对浏览器视窗的位置
524
525
526
527
思路理清之后,剩下的就容易了。
528
529
530
531
+有 2 个思路途径:
532
533
+1. 使用 Three.js 提供的 EventDispatcher
534
535
+ ```
536
+ import { EventDispatcher } from 'three'
537
538
539
+2. 使用 原生 JS 提供的 EventTarget
540
541
542
543
+额~ 因为最近接了一个设计的活,本文先暂停更新几天。
544
0 commit comments