
| 知识点
1. pointer-events
pointer-events:auto |none |visiblePainted |visibleFill |visibleStroke |visible |painted |fill |stroke |all |inherit
css3 pointer-events(阻止hover、active、onclick等触发事件
- 阻止用户的点击动作产生任何效果
- 阻止缺省鼠标指针的显示
- 阻止CSS里的
hover和active状态的变化触发事件 - 阻止JavaScript点击动作触发的事件
使用
提交页面,提交按钮点击后,添加这个样式属性(style=”pointer-events”),来防止重复提交。
pointer-events属性有很多值,但是对于浏览器来说,只有auto和non两个值可用,其它的几个是针对SVG的
2. eventCallback()
gsap的eventCallback()函数
.eventCallback( type:String, callback:Function, params:Array, scope:* ) : *
获取或者设置事件,例如”onComplete”, “onUpdate”, “onStart”, “onReverseComplete” , “onRepeat” (onRepeat 只应用在 TweenMax 或者 TimelineMax 实例),以及应传递给该回调的任何参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| type | String | 是 | 事件回调的类型,如 “onComplete”, “onUpdate”, “onStart” 或 “onRepeat”。这是区分大小写的。 |
| callback | Function | 否 | 事件发生时应调用的函数,default = null |
| params | Array | 否 | 传递回调的参数数组。用 “{self}” 指动画实例本身。例: [“param1”,”{self}”],default = null |
| scope | 否 | 回调调用的范围(基本上代表函数中”this”指的是什么),default = null |
