装饰器(Decorator)语法
用途:
1.装饰类
2.装饰方法或属性
用法
装饰器函数可以接受三个参数: target , prop ,descriptor
descriptor 有四个属性
configurable:false,//能否使用delete、能否需改属性特性......
装饰器(Decorator)语法
用途:
1.装饰类
2.装饰方法或属性
用法
装饰器函数可以接受三个参数: target , prop ,descriptor
descriptor 有四个属性
configurable:false,//能否使用delete、能否需改属性特性......
事件
onopen 、onmessage、onclose
方法
send() close()
var ws = new WebSocket("wss://echo.websocket.org");
ws.onopen = function(evt) {
consol......
实现无限滚动:
假设有五张图片需要轮播:1,2,3,4,5
在页面中,增加第一张图片的拷贝放至末尾,增加第五张的拷贝放至最开始:5⃣️,1,2,3,4,5,1⃣️
当页面滚动到1⃣️时,在滚动完成后,将left值设置到1的位置(此处没有动画,用户无法察觉);
同理,当页面滚......