Javascript Flowtype不工作?
我正在尝试使用flowtype作为响应文本,但它不起作用?文件flowtype.js与我的索引文件位于同一文件夹中。以下是我的身体和头部标签: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
<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但是在身体里,不是吗?