css-scrollbars.js 427 B

12345678910111213141516171819
  1. // Stylable scrollbars detection
  2. Modernizr.addTest('cssscrollbar', function() {
  3. var bool,
  4. styles = "#modernizr{overflow: scroll; width: 40px }#" +
  5. Modernizr._prefixes
  6. .join("scrollbar{width:0px}"+' #modernizr::')
  7. .split('#')
  8. .slice(1)
  9. .join('#') + "scrollbar{width:0px}";
  10. Modernizr.testStyles(styles, function(node) {
  11. bool = 'scrollWidth' in node && node.scrollWidth == 40;
  12. });
  13. return bool;
  14. });