browser.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>jQuery NiceScroll Browser Detection</title>
  6. <style type="text/css">
  7. .testok {
  8. background-color: #71FF71;
  9. }
  10. .testko {
  11. background-color: #FF6C6C;
  12. }
  13. body {
  14. font-family: Verdana, Arial, Helvetica, sans-serif;
  15. font-size: 12px;
  16. }
  17. .divs {
  18. padding-top: 4px;
  19. }
  20. .num {
  21. font-size: 10px;
  22. color: #525252;
  23. vertical-align: super;
  24. }
  25. </style>
  26. <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
  27. <script src="js/jquery.nicescroll.min.js"></script>
  28. <script>
  29. var nice = false;
  30. $(function() {
  31. nice = $("html").niceScroll();
  32. });
  33. var obj = window;
  34. console.log(obj.length);
  35. console.log("selector" in obj);
  36. </script>
  37. <script>
  38. function toCell(px,py,ok) {
  39. $("#tab1").find('tr').eq(py).find('td').eq(px).addClass((ok)?'testok':'testko');
  40. };
  41. $(window).load(function() {
  42. $("#div1").html($("#div1").html()+' '+nice.version);
  43. $("#div2").html($("#div2").html()+' '+navigator.userAgent);
  44. toCell(1,1,nice.detected.ismozilla);
  45. toCell(2,1,(nice.detected.iswebkit));
  46. toCell(3,1,nice.detected.isie);
  47. toCell(3,2,nice.detected.isie10);
  48. toCell(3,3,nice.detected.isie9);
  49. toCell(3,4,nice.detected.isie8);
  50. toCell(3,5,nice.detected.isie7);
  51. toCell(3,6,nice.detected.isieold);
  52. toCell(7,1,nice.detected.isie11);
  53. toCell(7,2,nice.detected.ismsedge);
  54. toCell(4,1,nice.detected.isopera);
  55. toCell(4,2,nice.detected.isopera12);
  56. toCell(4,3,nice.detected.isoperamini);
  57. toCell(5,1,nice.detected.isios);
  58. toCell(5,2,nice.detected.isios4);
  59. toCell(5,3,nice.detected.isios8);
  60. toCell(5,4,nice.detected.isios10);
  61. toCell(6,1,nice.detected.ischrome);
  62. toCell(6,2,nice.detected.ischrome22);
  63. toCell(6,3,nice.detected.ischrome26);
  64. toCell(0,8,nice.detected.cantouch);
  65. toCell(3,8,nice.detected.hasmstouch);
  66. toCell(7,8,nice.detected.hasw3ctouch);
  67. toCell(1,10,nice.detected.hastransform);
  68. toCell(1,11,nice.detected.hastranslate3d);
  69. toCell(2,10,nice.detected.hastransition);
  70. toCell(2,11,!!nice.detected.transitionend);
  71. toCell(3,10,nice.hasanimationframe);
  72. toCell(3,11,nice.hascancelanimationframe);
  73. toCell(4,10,nice.detected.hasMutationObserver);
  74. toCell(1,12,nice.detected.hasmousecapture);
  75. toCell(2,12,((nice.detected.cursorgrabvalue!='')&&(nice.detected.cursorgrabvalue.substr(0,3)!='url')));
  76. toCell(3,12,nice.detected.haspointerlock);
  77. toCell(1,14,!nice.detected.cantouch);
  78. toCell(2,14,!nice.detected.cantouch);
  79. toCell(3,14,nice.detected.cantouch||nice.istouchcapable||nice.hasmstouch||nice.detected.hasw3ctouch);
  80. //toCell(4,14,nice.detected.isie9mobile);
  81. });
  82. </script>
  83. </head>
  84. <body>
  85. <p>CHECK YOU BROWSER PAGE</p>
  86. <div id="div1">NiceScroll version:</div>
  87. <div id="div2">You browser user agent:</div>
  88. <table border="0" cellpadding="6" cellspacing="2" id="tab1">
  89. <tr>
  90. <td>&nbsp;</td>
  91. <td>&nbsp;</td>
  92. <td>&nbsp;</td>
  93. <td>&nbsp;</td>
  94. <td>&nbsp;</td>
  95. <td>&nbsp;</td>
  96. <td>&nbsp;</td>
  97. </tr>
  98. <tr>
  99. <td bgcolor="#E0E0E9">Browser class</td>
  100. <td bgcolor="#E0E0E9">Mozilla</td>
  101. <td bgcolor="#E0E0E9">WebKit</td>
  102. <td bgcolor="#E0E0E9">IE</td>
  103. <td bgcolor="#E0E0E9">Opera</td>
  104. <td bgcolor="#E0E0E9">iOS <span class="num">(7)</span></td>
  105. <td bgcolor="#E0E0E9">Chrome</td>
  106. <td bgcolor="#E0E0E9">IE11+</td>
  107. </tr>
  108. <tr>
  109. <td bgcolor="#E0E0E9">Families</td>
  110. <td bgcolor="#E0E0E9">&nbsp;</td>
  111. <td bgcolor="#E0E0E9">&nbsp;</td>
  112. <td bgcolor="#E0E0E9">IE10+</td>
  113. <td bgcolor="#E0E0E9">Opera&nbsp;12</td>
  114. <td bgcolor="#E0E0E9">iOS4- <span class="num">(6)</span></td>
  115. <td bgcolor="#E0E0E9">Chrome 22+</td>
  116. <td bgcolor="#E0E0E9">MSEdge</td>
  117. </tr>
  118. <tr>
  119. <td bgcolor="#E0E0E9">&nbsp;</td>
  120. <td bgcolor="#E0E0E9">&nbsp;</td>
  121. <td bgcolor="#E0E0E9">&nbsp;</td>
  122. <td bgcolor="#E0E0E9">IE9+</td>
  123. <td bgcolor="#E0E0E9">Opera&nbsp;Mini</td>
  124. <td bgcolor="#E0E0E9">iOS8</td>
  125. <td bgcolor="#E0E0E9">Chrome 26+</td>
  126. <td bgcolor="#E0E0E9">&nbsp;</td>
  127. </tr>
  128. <tr>
  129. <td bgcolor="#E0E0E9">&nbsp;</td>
  130. <td bgcolor="#E0E0E9">&nbsp;</td>
  131. <td bgcolor="#E0E0E9">&nbsp;</td>
  132. <td bgcolor="#E0E0E9">IE8</td>
  133. <td bgcolor="#E0E0E9">&nbsp;</td>
  134. <td bgcolor="#E0E0E9">iOS10</td>
  135. <td bgcolor="#E0E0E9">&nbsp;</td>
  136. <td bgcolor="#E0E0E9">&nbsp;</td>
  137. </tr>
  138. <tr>
  139. <td bgcolor="#E0E0E9">&nbsp;</td>
  140. <td bgcolor="#E0E0E9">&nbsp;</td>
  141. <td bgcolor="#E0E0E9">&nbsp;</td>
  142. <td bgcolor="#E0E0E9">IE7</td>
  143. <td bgcolor="#E0E0E9">&nbsp;</td>
  144. <td bgcolor="#E0E0E9">&nbsp;</td>
  145. <td bgcolor="#E0E0E9">&nbsp;</td>
  146. <td bgcolor="#E0E0E9">&nbsp;</td>
  147. </tr>
  148. <tr>
  149. <td bgcolor="#E0E0E9">&nbsp;</td>
  150. <td bgcolor="#E0E0E9">&nbsp;</td>
  151. <td bgcolor="#E0E0E9">&nbsp;</td>
  152. <td bgcolor="#E0E0E9">IE6- <span class="num">(1)</span></td>
  153. <td bgcolor="#E0E0E9">&nbsp;</td>
  154. <td bgcolor="#E0E0E9">&nbsp;</td>
  155. <td bgcolor="#E0E0E9">&nbsp;</td>
  156. <td bgcolor="#E0E0E9">&nbsp;</td>
  157. </tr>
  158. <tr>
  159. <td>&nbsp;</td>
  160. <td>&nbsp;</td>
  161. <td>&nbsp;</td>
  162. <td>&nbsp;</td>
  163. <td>&nbsp;</td>
  164. <td>&nbsp;</td>
  165. <td>&nbsp;</td>
  166. <td>&nbsp;</td>
  167. </tr>
  168. <tr bgcolor="#E0E0E9">
  169. <td>Touch</td>
  170. <td>&nbsp;</td>
  171. <td>&nbsp;</td>
  172. <td>MSPointer</td>
  173. <td>&nbsp;</td>
  174. <td>&nbsp;</td>
  175. <td>&nbsp;</td>
  176. <td>Pointer (W3C)</td>
  177. </tr>
  178. <tr>
  179. <td>&nbsp;</td>
  180. <td>&nbsp;</td>
  181. <td>&nbsp;</td>
  182. <td>&nbsp;</td>
  183. <td>&nbsp;</td>
  184. <td>&nbsp;</td>
  185. <td>&nbsp;</td>
  186. <td>&nbsp;</td>
  187. </tr>
  188. <tr>
  189. <td bgcolor="#E0E0E9">Browser capabilities</td>
  190. <td bgcolor="#E0E0E9">Transform <span class="num">(2)</span></td>
  191. <td bgcolor="#E0E0E9">Transition <span class="num">(4)</span></td>
  192. <td bgcolor="#E0E0E9">AnimationFrame <span class="num">(5)</span></td>
  193. <td bgcolor="#E0E0E9">MutationObserver</td>
  194. <td bgcolor="#E0E0E9">&nbsp;</td>
  195. <td bgcolor="#E0E0E9">&nbsp;</td>
  196. <td bgcolor="#E0E0E9">&nbsp;</td>
  197. </tr>
  198. <tr>
  199. <td bgcolor="#E0E0E9">&nbsp;</td>
  200. <td bgcolor="#E0E0E9">translate3d <span class="num">(3)</span></td>
  201. <td bgcolor="#E0E0E9">transitionEnd</td>
  202. <td bgcolor="#E0E0E9">cancelAnimationFrame</td>
  203. <td bgcolor="#E0E0E9">&nbsp;</td>
  204. <td bgcolor="#E0E0E9">&nbsp;</td>
  205. <td bgcolor="#E0E0E9">&nbsp;</td>
  206. <td bgcolor="#E0E0E9">&nbsp;</td>
  207. </tr>
  208. <tr>
  209. <td bgcolor="#E0E0E9">&nbsp;</td>
  210. <td bgcolor="#E0E0E9">setCapture</td>
  211. <td bgcolor="#E0E0E9">cursor:grab</td>
  212. <td bgcolor="#E0E0E9">Pointer Lock API</td>
  213. <td bgcolor="#E0E0E9">&nbsp;</td>
  214. <td bgcolor="#E0E0E9">&nbsp;</td>
  215. <td bgcolor="#E0E0E9">&nbsp;</td>
  216. <td bgcolor="#E0E0E9">&nbsp;</td>
  217. </tr>
  218. <tr>
  219. <td>&nbsp;</td>
  220. <td>&nbsp;</td>
  221. <td>&nbsp;</td>
  222. <td>&nbsp;</td>
  223. <td>&nbsp;</td>
  224. <td>&nbsp;</td>
  225. <td>&nbsp;</td>
  226. <td>&nbsp;</td>
  227. </tr>
  228. <tr bgcolor="#E0E0E9">
  229. <td>Input</td>
  230. <td>Keyboard</td>
  231. <td>Mouse</td>
  232. <td>Touch/Pen</td>
  233. <td>&nbsp;</td>
  234. <td>&nbsp;</td>
  235. <td>&nbsp;</td>
  236. <td>&nbsp;</td>
  237. </tr>
  238. </table>
  239. <p>&nbsp; </p>
  240. <p>(1) position:fixed not supported, scrollbar for page and zoom features disabled<br />
  241. (2) hardware scroll for wrapped div<br />
  242. (3) hardware scroll preferable for mobile devices<br />
  243. (4) transition (animation) used for scroll content (hw full implementation)<br />
  244. (5) more smooth native scroll and cpu saving<br />
  245. (6) some problem with zoom feature for browser limitation<br />
  246. (7) use native scrollbar for page<br />
  247. </p>
  248. <p>&nbsp; </p>
  249. <script type="text/javascript">
  250. var _gaq = _gaq || [];
  251. _gaq.push(['_setAccount', 'UA-26840957-1']);
  252. _gaq.push(['_setDomainName', '.areaaperta.com']);
  253. _gaq.push(['_trackPageview']);
  254. (function() {
  255. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  256. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  257. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  258. })();
  259. </script>
  260. </body>
  261. </html>