1/*! fixed-fixed - v0.1.0 - 2014-05-23 2* Copyright (c) 2014 ; Licensed MIT */ 3/*! Fixedfixed: a CSS position:fixed qualifier. (c)2012 @scottjehl, Filament Group, Inc. Dual license: MIT and/or GPLv2 */ 4(function(w, undefined) { 5 var htmlclass = "fixed-supported", el = w.document.createElement("div"), ua = w.navigator.userAgent, docEl = w.document.documentElement; 6 // fix the test element 7 el.style.position = "fixed"; 8 el.style.top = 0; 9 // support test 10 function checkFixed() { 11 var scroll = "scrollTop" in w.document.body ? w.document.body.scrollTop : docEl.scrollTop; 12 // only run test if there's a scroll we can compare 13 if (scroll !== undefined && scroll > 0 && w.document.body) { 14 w.document.body.insertBefore(el, w.document.body.firstChild); 15 // Fix: On IOS 'getBoundingClientRect().top' returned the incorrect results for elements 16 if (ua.match(/(iPhone|iPad|iPod)/)) { 17 if (el.offsetTop !== 0) { 18 // Fixed is not working or can't be tested 19 docEl.className = docEl.className.replace(htmlclass, ""); 20 } 21 } else { 22 if (!el.getBoundingClientRect || el.getBoundingClientRect().top !== 0) { 23 // Fixed is not working or can't be tested 24 docEl.className = docEl.className.replace(htmlclass, ""); 25 } 26 } 27 // remove the test element 28 w.document.body.removeChild(el); 29 // unbind the handlers 30 if (w.removeEventListener) { 31 w.removeEventListener("scroll", checkFixed, false); 32 } else { 33 w.detachEvent("onscroll", checkFixed); 34 } 35 } 36 } 37 // if a particular UA is known to return false results with this feature test, try and avoid that UA here. 38 if (// Android 2.1, 2.2, 2.5, and 2.6 Webkit 39 !(ua.match(/Android 2\.[1256]/) && ua.indexOf("AppleWebKit") > -1) || // Opera Mobile less than version 11.0 (7458) 40 !(ua.match(/Opera Mobi\/([0-9]+)/) && RegExp.$1 < 7458) || // Opera Mini 41 !(ua.match(/(iPhone|iPad|iPod) (OS [0-4]+)/)) || // Iphone / Ipad / Ipod 42 !(w.operamini && {}.toString.call(w.operamini) === "[object OperaMini]") || // Firefox Mobile less than version 6 43 !(ua.match(/Fennec\/([0-9]+)/) && RegExp.$1 < 6)) { 44 //add the HTML class for now. 45 docEl.className += " " + htmlclass; 46 // bind to scroll event so we can test and potentially degrade 47 if (w.addEventListener) { 48 w.addEventListener("scroll", checkFixed, false); 49 } else { 50 w.attachEvent("onscroll", checkFixed); 51 } 52 } 53 w.FixedFixed = checkFixed; 54})(this);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.