Http://www.cnblogs.com/foolisher/p/5412723.html
http://blog.csdn.net/b7995547/article/details/48951761
Http://www.cnblogs.com/koukouyifan/p/4066567.html
CSS Device-width how to get in JS
0,js to determine whether it is a mobile phone or a PC:
function IsPC () {
var useragentinfo = navigator.useragent;
var Agents = ["Android", "IPhone",
"SymbianOS", "Windows Phone",
" IPad", "IPod");
var flag = true;
For (var v = 0; v < agents.length; v++) {
if (Useragentinfo.indexof (Agents[v]) > 0) {
flag = false;
Break ;
}
}
return flag;
}
var flag = IsPC (),//true for PC, false for mobile
1. Introduction to Touch Events
The Web page mouse on the PC generates onmousedown, onmouseup, onmouseout, onmouseover, onmousemove events, but on mobile devices such as iphone, ipod Touch, The Ontouchstart, Ontouchmove, Ontouchend, Ontouchcancel events are generated when the Web page on the ipad touches the screen, corresponding to the touch screen start, drag and finish, and the touch screen event and cancellation. when the finger is pressed, the ontouchstart is triggered;when moving the finger, trigger ontouchmove;triggers the ontouchend when the finger is removed. when some higher-level events occur (such as phone access or pop-up messages), the current touch operation is triggered, triggering ontouchcancel. The game, archive, and so on are usually paused during ontouchcancel. 2. The relationship between touch events and mouse events
After the touch screen operation, the moment the finger is lifted (i.e. after ontouchend), the system will determine whether the content of the element receiving the event has been changed, if the content is changed, the next event will not be triggered, if not changed, will follow the Mousedown,mouseup, The Click order triggers the event. In particular, the Mouseout event of the previous event is triggered only when a touch-screen event is triggered again
Mobile-Touch Events Ontouchstart, Ontouchmove, Ontouchend, Ontouchcancel