-
Notifications
You must be signed in to change notification settings - Fork 2
/
supportspositionfixed.js
29 lines (28 loc) · 1.09 KB
/
supportspositionfixed.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var supportsPositionFixed = (function() {
var w = window,
ua = navigator.userAgent,
ret = true;
// Black list the following User Agents
if (
// IE less than 7.0
(/MSIE (\d+\.\d+);/i.test(ua) && RegExp.$1 < 7) ||
// iOS less than 5
(/OS [2-4]_\d(_\d)? like Mac OS X/i.test(ua)) ||
// Android less than 3
(/Android ([0-9]+)/i.test(ua) && RegExp.$1 < 3) ||
// Windows Phone less than 8
(/Windows Phone OS ([0-9])+/i.test(ua) && RegExp.$1 < 8) ||
// Opera Mini
(w.operamini && ({}).toString.call( w.operamini ) === "[object OperaMini]") ||
// Kindle Fire
(/Kindle Fire/i.test(ua) || /Silk\//i.test(ua)) ||
// Nokia Symbian, Opera Mobile, wOS
(/Symbian/i.test(ua)) || (/Opera Mobi/i.test(ua)) || (/wOSBrowser/i.test(ua)) ||
// Firefox Mobile less than 6
(/Fennec\/([0-9]+)/i.test(ua) && RegExp.$1 < 6)
// Optionally add additional browsers/devices here . . .
){
ret = false;
}
return ret;
})();