-webkit-overflow-scrolling
is new to iOS 5. I'm looking for a CSS polyfill or a method rather than user agent reading for detecting if this feature is available. Modernizer don't detect this.
A polyfill is a piece of code (usually JavaScript on the Web) used to provide modern functionality on older browsers that do not natively support it.
For example, a polyfill could be used to mimic the functionality of an HTML Canvas element on Microsoft Internet Explorer 7 using a Silverlight plugin, or mimic support for CSS rem units, or text-shadow , or whatever you want.
Formally, "a polyfill is a shim for a browser API." Polyfills allow web developers to use an API regardless of whether or not it is supported by a browser, and usually with minimal overhead. Typically they first check if a browser supports an API, and use it if available, otherwise using their own implementation.
Polyfill.io makes polyfilling support for newer JS features in older browsers super easy. It works via User-Agent sniffing to determine the browser being used, then loads the required polyfills. Explicitly define the features from the ECMAscript spec your code relies on.
Modernizr doesn't detect the property by default, but you can add your own test to it.
Just call this code anywhere:
Modernizr.addTest('overflowscrolling', function() {
return Modernizr.testAllProps("overflowScrolling");
});
after the call, your body
element will either have a overflowscrolling
or a no-overflowscrolling
class and you can check the support against Modernizr.overflowscrolling
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With