当前位置:网站首页>day39 原型链及页面烟花效果 2021.10.13
day39 原型链及页面烟花效果 2021.10.13
2022-06-28 11:20:00 【即将成为大佬的小梦】
原型链:(Object是顶级的构造函数,在js中万物皆对象)
只要是对象就有一个属性__proto__,
原型对象也是对象,所以原型对象也有__proto__属性,这个属性指向的也是一个原型对象
实例对象的__proto__指向原型对象,原型对象的__proto__指向另外的一个原型对象,都是对象,都有__proto__属性,所以最后找到的原型都是Object.prototype

实例对象方法属性的访问规则:
实例对象访问属性的时候,先在实例对象本身查找,找到了就使用
如果找不到,则在__proto__指向的原型对象中查找,找到了就使用
如果找不到在去到原型对象的原型中找,找到了就是使用
找不到继续往原型的原型中找,最终找到Object.prototype原型,
还是没有属性或方法的话,则返回undefined

实现页面烟花效果:
步骤分析:
1. 出现一个夜空背景 1000*600

2. 给夜空一个点击事件,点击夜空div在底部出现一个方块烟花

--方块烟花出现的位置,和点击的水平位置是一样的
3. 方块烟花从底部升空,升到点击的位置,然后消失(消失后出现多个圆点烟花)

4. 圆点烟花爆炸效果,每一个圆点烟花运动到随机的位置,然后消失

需准备的函数:
运动函数,随机颜色函数,获取范围随机数的函数,给元素设置样式的函数





边栏推荐
- Does flink1.15 support MySQL views? I configured the view name at the table name to save, but the table could not be found. Think
- 100 important knowledge points that SQL must master: retrieving data
- 什么是DAPP系统发展与解析理解
- [practice] appium settings app is not running after 5000ms
- JS foundation 1-js introduction and operator
- Word、PDF、TXT文件实现全文内容检索需要用什么方法?
- 毕业季 新的开始
- Excel导入导出便捷工具类
- Summary of spatial temporal time series prediction modeling methods
- Yann LeCun新论文:构建自动智能体之路
猜你喜欢
随机推荐
This Exception was thrown from a job compiled with Burst, which has limited exception support. 报错
Blackmail virus of industrial control security
培训通知|2022年境外中资企业机构及人员疫情防控和安全防范专题培训通知
李宏毅《机器学习》丨7. Conclusion(总结)
随机森林以及 AMR 训练出的诗词制造器
vsftpd服务的部署及优化
Remote connection of raspberry pie in VNC viewer mode without display
【agora】get 一个 agora_refptr 对象的用法示例
[QT] connect syntax reference implementation
What is the function of ICMP Protocol and the principle of Ping of death attack?
Which broker is safer and more convenient to open an account for Oriental Fortune mobile stock?
JS基础2
近况
[function suggestion] select a space when multiple workspaces are started
一套十万级TPS的IM综合消息系统的架构实践与思考
Wealth management for programmers
功能真花哨,价格真便宜!长安全新SUV真实力到底怎样?
Splicing strings in the string collection_ Stream based
Oracle 日期格式化异常:无效数字
论文阅读 (59):Keyword-Based Diverse Image Retrieval with Variational Multiple Instance Graph









