var browser={versions:function () {var u = navigator.useragent, app = Navigator.appversion; return {trident:u.indexof (' Trident ') >-1,//ie kernel presto:u.indexof (' presto ') >-1,//opera kernel Webkit:u.indexof (' AppleWebKit ') >-1,//Apple, Google kernel gecko:u.indexof (' Gecko ') >-1 && u.indexof (' khtml ') = = -1,//Firefox core mobile:!! U.match (/applewebkit.*mobile.*/),//Whether for Mobile terminal iOS:!! U.match (/\ (i[^;] +;( U;)? Cpu.+mac OS x/),//ios terminal Android:u.indexof (' Android ') >-1 | | U.indexof (' Adr ') | | U.indexof (' Linux ') >-1,//android terminal or UC Browser iphone:u.indexof (' iphone ') >-1,//whether for IPhone or Qqhd browser Ipad:u.indexof (' ipad ') >-1,//whether the IPad webapp:u.indexof (' Safari ') = = 1,//whether the Web should program, no head with the bottom Weixi N:u.indexof (' Micromessenger ') >-1,//whether (added in 2015-01-22) qq:u.match (/\sqq/i) = = "QQ"//Whether QQ}; } (), Language: (Navigator.browserlanguage | | navigator.language). ToLowerCase ()
Usage:
if (Browser.versions.iPad) {
$(". Mapjsbtn "). Click (function (e) {
Alert (1)
})
Mobile phone cross-screen media query
@media screen and (Orientation:landscape) {
. Checkstatemenu,.mainnav. Mainnav-inner. list{
max-height:250px;
Overflow-y: auto;
}
}
JS to determine the user's use of equipment and mobile vertical screen code implementation