当前位置:网站首页>Day39 prototype chain and page fireworks effect 2021.10.13
Day39 prototype chain and page fireworks effect 2021.10.13
2022-06-28 11:23:00 【Little dream of becoming a big man】
Prototype chain :(Object Is a top-level constructor , stay js Everything is an object )
As long as an object has a property __proto__,
Prototype objects are also objects , So the prototype object also has __proto__ attribute , This attribute also points to a prototype object
Of instance objects __proto__ Point to the prototype object , Of a prototype object __proto__ Point to another prototype object , Are all objects , There are __proto__ attribute , So all the prototypes we finally found were Object.prototype

Access rules for instance object method properties :
When an instance object accesses properties , First, find the instance object itself , Use it when you find it
If you can't find it , It's in __proto__ Point to the prototype object , Use it when you find it
If not, find it in the prototype that goes to the prototype object , Find it and use it
Can't find. Continue to find in the prototype of the prototype , Finally find Object.prototype Prototype ,
If there are no properties or methods , Then return to undefined

Realize the fireworks effect on the page :
Step analysis :
1. A night sky background appears 1000*600

2. Give the night sky a click event , Click on the night sky div A square fireworks appears at the bottom

-- Where the square fireworks appear , It is the same as the horizontal position of the click
3. Square fireworks lifted off from the bottom , Rise to the click position , And then disappear ( After disappearing, multiple dot fireworks appear )

4. Dot fireworks explosion effect , Each dot moves to a random position , And then disappear

Functions to be prepared :
Motion function , Random color function , A function that gets a range of random numbers , Functions that style elements





边栏推荐
- SQL必需掌握的100个重要知识点:检索数据
- 毕业了
- Everyone can participate in open source! Here comes the most important developer activity in dragon lizard community
- Compareto() and equals() methods of BigDecimal class
- Zero foundation self-study SQL course | if function
- [sword finger offer] 49 Ugly number
- Katalon framework tests a web page operation example code
- JS基础8
- Excel导入导出便捷工具类
- Apache2配置对目录拒绝访问,但是可以访问里面文件的设置
猜你喜欢

爱可可AI前沿推介(6.28)

远程登录sshd服务

Making and using of static library

Yann LeCun新论文:构建自动智能体之路

Industry analysis - quick intercom, building intercom

TiDB v6.0.0 (DMR) :缓存表初试丨TiDB Book Rush

Docker modifies the user name and password of MySQL

Everyone can participate in open source! Here comes the most important developer activity in dragon lizard community

Thesis reading (59):keyword based diverse image retrieval with variable multiple instance graph

字符串 & 堆 & 方法区
随机推荐
个人买场内基金选择什么证券公司开户好,更安全
Word、PDF、TXT文件实现全文内容检索需要用什么方法?
Blackmail virus of industrial control security
Move command
动态库(共享库)的制作和使用
行业分析| 快对讲,楼宇对讲
合约量化交易系统开发 | 合约量化APP开发(现成案例)
人人都可以参与开源!龙蜥社区最不容错过的开发者活动来了
Lihongyi, machine learning 7 Conclusion
Dataease installation upgrade
【SemiDrive源码分析】【X9芯片启动流程】32 - DisPlay模块分析 - RTOS侧
一套十万级TPS的IM综合消息系统的架构实践与思考
New listing of operation light 3.0 - a sincere work of self subversion across the times!
使用 Calendar 计算时间
Wealth management for programmers
What is the function of ICMP Protocol and the principle of Ping of death attack?
BigDecimal 类的 compareTo() 和 equals()方法
mysql-. SQL file phishing Online
Calculate time using calendar
How to distinguish and define DQL, DML, DDL and DCL in SQL