Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html CSS3和cssanimations的现代化检查不起作用_Html_Css_Modernizr - Fatal编程技术网

Html CSS3和cssanimations的现代化检查不起作用

Html CSS3和cssanimations的现代化检查不起作用,html,css,modernizr,Html,Css,Modernizr,如果我的网站检测到CSS3不受支持,我将无法重定向我的网站。我使用CSS3动画,所以我决定测试它们,但我无法让它重定向,更不用说在我的系统中执行alert()消息了。请帮帮我。谢谢大家! <!DOCTYPE html> <html> <head> <title>95.3 FM - KXLE Stream</title> <script type="text/javascript" src="modernizr.c

如果我的网站检测到CSS3不受支持,我将无法重定向我的网站。我使用CSS3动画,所以我决定测试它们,但我无法让它重定向,更不用说在我的系统中执行alert()消息了。请帮帮我。谢谢大家!

    <!DOCTYPE html>
<html>
<head>
    <title>95.3 FM - KXLE Stream</title>
 <script type="text/javascript" src="modernizr.custom.86596.js"></script>
    <link rel="icon" type="image/png" href="images/favicon.png">
    <link rel="stylesheet" type="text/css" href="css/style.css">
        <link href="css/ui-lightness/jquery-ui-1.10.3.custom.css" rel="stylesheet">
    <script src="js/jquery-1.9.1.js"></script>
    <script src="js/jquery-ui-1.10.3.custom.js"></script>
    <script type="text/javascript" src="js/js.js"></script>
<script> //THIS IS WHAT WILL NOT WORK********************************************
    if (!Modernizr.cssanimations) {
        window.location.href = 'www.google.com';
    }
</script>

</head>

95.3调频-KXLE流
//这是行不通的********************************************
如果(!modernizer.cssanimations){
window.location.href='www.google.com';
}
您想使用

   if (Modernizr.cssanimations) {
    window.location.replace("http://google.com");
    }

解决了!我没有指出modernizer js文件在我脑海中的正确位置。

肯定/应该/正在工作。您的控制台中是否有任何错误?您可以发布一个显示相同行为的JSFIDLE吗?