摘要: 定义和用法 setInterval() 方法可按照指定的周期(以毫秒计)来调用函数或计算表达式。 setInterval() 方法会不停地调用函数,直到 clearInterval() 被调用或窗口被关闭。由 setInterval() 返回的 ID 值可用作 clearInterval() 方法的 阅读全文
posted @ 2020-06-01 19:14 梅谷暴君 阅读(23311) 评论(2) 推荐(1) 编辑
摘要: 事件侦听 创建自定义事件 可以使用Event构造函数创建事件,如下所示: var event = new Event('build'); // Listen for the event. elem.addEventListener('build', function (e) { /* ... */ 阅读全文
posted @ 2020-06-01 14:01 梅谷暴君 阅读(458) 评论(0) 推荐(0) 编辑