我正在尝试对响应式文本使用flowtype,但它不起作用?文件flowtype.js与我的索引文件在同一个文件夹中。下面是我的body和head标签:
<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>发布于 2014-05-02 11:40:04
位置中的代码不能获取$('body')。我建议您可以修改代码,如下所示:
$(function() {
$('body').flowtype();
});发布于 2014-05-02 12:11:53
@andryuu87:
假设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>https://stackoverflow.com/questions/23420239
复制相似问题