Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/390.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
Javascript Flowtype不工作?_Javascript_Jquery_Html_Css - Fatal编程技术网

Javascript Flowtype不工作?

Javascript Flowtype不工作?,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我正在尝试使用flowtype作为响应文本,但它不起作用?文件flowtype.js与我的索引文件位于同一文件夹中。以下是我的身体和头部标签: <head> <link rel="stylesheet" type="text/css" href="index.css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script sr

我正在尝试使用flowtype作为响应文本,但它不起作用?文件flowtype.js与我的索引文件位于同一文件夹中。以下是我的身体和头部标签:

 <head>
    <link rel="stylesheet" type="text/css" href="index.css">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="jquery-1.11.0.js"></script>
    <script src="flowtype.js"></script>
    <link rel="shortcut icon" href="zpics/maikalogo.ico" >
        <title>Website</title>
    <style>
        body {
              background: url(background.jpg) no-repeat center center fixed; 
              -webkit-background-size: cover;
              -moz-background-size: cover;
              -o-background-size: cover;
              background-size: cover;
    </style>
</head>
<body>
        <script> 
            $('body').flowtype();
        </script>
<p>texttextmoretext</p>
</body>

网站
身体{
背景:url(background.jpg)无重复中心固定;
-webkit背景尺寸:封面;
-moz背景尺寸:封面;
-o-背景尺寸:封面;
背景尺寸:封面;
$('body').flowtype();
文本更多文本


您在无法获取$('body')的位置编写代码。我建议您可以按以下方式修改代码:

$(function() {
    $('body').flowtype();
});
@安德里欧87:

假设flowtype.js和jquery-1.11.0.js与上面的html文件位于同一文件夹中,则此代码可以工作:

<!doctype html>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="index.css">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="jquery-1.11.0.js"></script>
    <script src="flowtype.js"></script>
    <link rel="shortcut icon" href="zpics/maikalogo.ico" >
    <title>Website</title>
    <script>
        $(document).ready(function(){
            $('body').flowtype();
        });
    </script>
    <style>
        body {
            background: url(background.jpg) no-repeat center center fixed;
            -webkit-background-size: cover;
            -moz-background-size: cover;
            -o-background-size: cover;
            background-size: cover;
        }
    </style>
</head>
<body>
    <p>texttextmoretext</p>
</body>
</html>

网站
$(文档).ready(函数(){
$('body').flowtype();
});
身体{
背景:url(background.jpg)无重复中心固定;
-webkit背景尺寸:封面;
-moz背景尺寸:封面;
-o-背景尺寸:封面;
背景尺寸:封面;
}
文本更多文本


什么具体不起作用?脚本应该在
头部
中声明,而不是在
主体
中声明,这可能会导致问题。但是,除非您解释问题的原因,否则我们无法真正解决问题。正如David所问,什么具体不起作用?请在控制台中查找任何冲突check@C-链接,脚本是p但是在身体里,不是吗?