touch触屏事件
touches正在触摸屏幕的所有手指的列表
targetTouches正在触摸当前DOM元素的手指列表(如果这两个监听的是一个DOM元素,他们两个是 一样的结果)
changedTouches 手指状态发生了改变的列表,从无到有,或者从有到无
transitionend事件
transitionend事件等待监听过渡效果完成再执行里面的代码
ul.addEventListener('transitionend', function () {
if (index == 3) {
index = 0;
//去掉过度效果,让ul快速跳到目标位置
ul.style.transition = 'none';
//利用最新的索引号乘以宽度去滚动图片
var translatex = -index * w;
ul.style.transform = 'translateX(' + translatex + 'px)'
}
classList属性
切换类:classList.toggle('类名');
移动端常用插件网址
swiper中文官网地址:www.swiper.com.cn/
superslide:www.superslide2.com/
iscroll:github.com/cubiq/iscro…
前端还有常用的框架:Bootstrap、Vue、Angular、React等,即能开发PC端,又能开发移动端.