[英]Detecting if font family changes and showing the dialog box
i have written a HTML code 我已经写了一个HTML代码
i am using custom font(gotham.otf) in my CSS element and I want to detect if the html is loading with my custom font or not. 我在CSS元素中使用自定义字体(gotham.otf),我想检测html是否以我的自定义字体加载。 If html is not loading with my custom font I have to show the custom dialog. 如果html未使用我的自定义字体加载,则必须显示自定义对话框。
<body onload="myFunction()">
<script>
function myFunction()
{
Here I have to check whether browser is loading with custom font or not,If not show a dialog
confirm("Custom font may not work for some browsers!");
}
</script>
</body>
If this is not possible by this way please suggest me the better way to achieve It. 如果通过这种方式无法实现,请向我建议实现它的更好方法。
Help is always appreciated, Thanks 总是感谢帮助,谢谢
Modernizr: http : //modernizr.com/应该能够检测到
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.