在我们的应用程序中,我们有几个 html5 颜色输入,用户可以在其中选择背景颜色等。我刚刚在 ie 中进行测试,发现颜色选择器不想工作并且不受支持。
为了解决这个问题,我找到了一个垫片并将其插入 Modinizer。但是我似乎无法弄清楚如何在负载中测试它,并且无法真正找到任何示例。
我的代码如下所示
{
test: //window.Color ??,
nope: ['spectrum.js', 'spectrum.css']
}
最佳答案
在modernizr网站上它是clearly stated那个
HTML5 introduces thirteen new values for the 's type attribute. They are as follows: search, tel, url, email, datetime, date, month, week, time, datetime-local, number, range, color. These types can enable native datepickers, colorpickers, URL validation, and so on. If a browser doesn’t support a given type, it will be rendered as a text field. Modernizr cannot detect that date inputs create a datepicker, the color input create a colorpicker, and so on—it will detect that the input values are sanitized based on the spec. In the case of WebKit, we have received confirmation that sanitization will not be added without the UI widgets being in place.
所以,不幸的是,modernizr 没有给你任何关于 html5 输入的线索。
关于javascript - Modinizer 测试颜色输入类型是否可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29567299/