CSS3 的 polyfill“calc()”在 webkit 下?
我们中的许多人都对 Polyfill 感到兴奋,因为它可以让 IE 不再那么麻烦。但我最讨厌的是 WebKit。 WebKit到底是什么?你在其他方面都很棒;为什么你必须去而不实现 calc() ,嗯? ...但如果有填充的话,这没什么大不了的。
有没有?
谷歌在这一点上一反常态地简洁。那么:0 Hivemind,这样的东西存在吗?
Many of us have been thrilled with polyfills to make IE less of a drag. But my beef is with WebKit. What the hell, WebKit? You're so awesome at everything else; why did you have to go and not implement calc(), eh? ...but it's not a big deal if there's a polyfill.
Is there?
Google is uncharacteristically laconic on this point. So: 0 Hivemind, does such a thing exist?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Chrome 19 中已支持 calc(),并带有 -webkit- 前缀!不确定版本 19 需要多久才能向所有人推出,但应该会在接下来的几个月内。由于 IE9+ 和 Firefox 已经得到支持,最后的支持者将是 Safari 和 Opera。幸运的是,我相信今年夏天更新的 Safari 版本可能会与 OS X Mountain Lion 一起发布。我不确定 Opera 计划何时添加支持。
calc() support has landed in Chrome 19 with the -webkit- prefix! Not sure how long before version 19 gets pushed out to everyone, but it should be within the next few months. Since IE9+ and Firefox already have support, the last holdouts will be Safari and Opera. Fortunately I believe an updated Safari build is likely to be released with OS X Mountain Lion this summer. I'm not sure when Opera plans to add support.
我认为 Chrome 还没有为此提供的 polyfill……我还没有找到。我认为获得你需要的最好方法是使用 javascript。不幸的是,您还必须在浏览器调整大小时调用该脚本。
I don't think there is a polyfill for this for Chrome yet ... none that I have found. Best way to get what you need I think is to use javascript. Unfortunately you will have to call that script on browser resize as well.
https://github.com/CJKay/PolyCalc
这是一个好的开始。他们已经停止维护该项目,因为大多数浏览器都有 calc 可用,但运行良好。我发现了一些错误并在我的网站上修复了它们。
如果有人想知道我的修复请联系我
https://github.com/CJKay/PolyCalc
This is a good start. They have stopped maintaining the project due to most browsers haveing calc available but works well. I have found a couple bugs and fixed them on my sites.
If anyone would like to know my fixes please contact me