禁用 javascript 时检测 css 转换
我一直在使用带有javascript的modernizr来决定css转换是否可用,但是有没有一种方法可以在不使用javascript的情况下检查css转换是否正常工作?
I have been using modernizr with javascript to decide whether css transitions is available, but is there a way to check if css transitions are working, without using javascript?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为唯一有意义的场景是没有 CSS 动画支持且禁用 JS 的浏览器。在那里您可以显示一些消息,例如“请升级您的浏览器或启用 JS。”
您可以尝试在那里进行服务器端 UserAgent 嗅探,但我不推荐这样做。首先,它不可靠,其次,它根本不值得付出努力。使用此类浏览器的任何人都习惯于有限的功能。
I think the only scenario where that would make sense is a browser without CSS animation support and with JS disabled. There you could display some message like "Please upgrade your browser or enable JS."
You could try server-side UserAgent sniffing there, but I wouldn't recommend it. First of all, it's not reliable and second it's simply not worth the effort. Anyone using such a browser is used to limited functionality.