mirror of
https://github.com/wu736139669/vczero.github.io.git
synced 2026-08-06 06:41:41 +00:00
add fastclick
This commit is contained in:
+22
-1
@@ -13,5 +13,26 @@ requirejs([
|
||||
'home/search'
|
||||
],
|
||||
function(fastclick) {
|
||||
// fastclick(document.body);
|
||||
var ua = window.navigator.userAgent.toLocaleLowerCase();
|
||||
var bIsIpad = ua.match(/ipad/i) == 'ipad';
|
||||
var bIsIphoneOs = ua.match(/iphone os/i) == "iphone os";
|
||||
var bIsMidp = ua.match(/midp/i) == "midp";
|
||||
var bIsUc7 = ua.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
|
||||
var bIsUc = ua.match(/ucweb/i) == "ucweb";
|
||||
var bIsAndroid = ua.match(/android/i) == "android";
|
||||
var bIsCE = ua.match(/windows ce/i) == "windows ce";
|
||||
var bIsWM = ua.match(/windows mobile/i) == "windows mobile";
|
||||
//iPad优先
|
||||
if(bIsIpad){
|
||||
console.log('ipad');
|
||||
fastclick(document.body);
|
||||
return;
|
||||
}
|
||||
if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
|
||||
fastclick(document.body);
|
||||
console.log('mobile');
|
||||
} else {
|
||||
console.log('pc');
|
||||
}
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user