移动端相关事件

1、触摸事件:touchstart、touchend、touch

2、检测横竖屏:orientationchange

window.addEventListener('orientationchange', function(event){
if ( window.orientation == 180 || window.orientation==0 ) {
alert("竖屏");
}
if( window.orientation == 90 || window.orientation == -90 ) {
alert("横屏");
}
});
posted @ 2017-12-07 15:06  coconutGirl  阅读(141)  评论(0编辑  收藏  举报