Jquery可调整大小不起作用
我已经包含了所有jquerys文件,但是我仍然无法调整sqaure div的大小。我的文件保存在桌面上,jquery-1.11.1.min.js也存在于我的桌面上。为什么可调整大小的函数不起作用Jquery可调整大小不起作用,jquery,resize,Jquery,Resize,我已经包含了所有jquerys文件,但是我仍然无法调整sqaure div的大小。我的文件保存在桌面上,jquery-1.11.1.min.js也存在于我的桌面上。为什么可调整大小的函数不起作用 <!doctype html> <html> <head> <title>jQuery</title> <link rel="stylesheet" href="//ajax.googleapis.com/ajax
<!doctype html>
<html>
<head>
<title>jQuery</title>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
<script type="text/javascript" src="jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
#square{
width:400px;
height:400px;
background-color:green;
padding:3px;
}
</style>
</head>
<body>
<div id="square"></div>
<script>
$("#square").resizable();
</script>
</body>
</html>
jQuery
#方格{
宽度:400px;
高度:400px;
背景颜色:绿色;
填充:3倍;
}
$(“#square”).resizeable();
我复制了您的代码并使其在我的本地计算机上运行。我几乎可以肯定它不起作用,因为您没有正确加载资源
代码中很少有错误:
1) 将http:
放在//ajax
之前的链接和script
标记中
2) 你的jquery-1.11.1.min.js
文件必须与你的页面位于同一目录下才能工作(我觉得不是。如果你没有下载源文件,你可以使用。嘿,我刚刚尝试了你的代码,css文件出现404错误:
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
我将其替换为以下行:
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.all.css" />
它对我来说很好。works@Xenyal的版本使用jQuery的ready处理程序(他应该这样做)。也许OP也应该如此。你的jquery-1.11.1.min.js在同一个目录中,我在之前添加了http和https//ajax仍然不起作用……奇怪的是,它现在起作用了,不知道为什么它昨天不起作用了……我昨天尝试了http和https,但它不起作用,今天它同时起作用了http和https lol!@user3510922我猜是因为“/smoothness/”而不是“/base/”