我正在使用JQuery插件CHOSEN进行多项选择。但它不起作用。它不是创建下拉列表,而且选项是可见的,甚至无法选择它们。
的index.html
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/chosen.css" rel="stylesheet">
<link href="css/jquery-ui.css" rel="stylesheet">
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="cordova.js"></script>
<script src="js/app.js"></script>
<script src="js/jquery.js"></script>
<script src="js/jquery-ui.js"></script>
<script src="js/chosen.jquery.js"></script>
</head>
</html>
selected.html代码:
<head>
<script type="text/javascript">
$(function() {
$(".chzn-select").chosen();
});
</script>
</head>
<ion-view view-title="Profile">
<ion-content class="padding">
<div>
<label class="item item-input">
<div class="input-label">Enter Your Option</div>
<select class="chzn-select" multiple="true" name="faculty" style="width:1000px;">
<option value="Option 2.1">Option 2.1</option>
<option value="Option 2.2">Option 2.2</option>
<option value="Option 2.3">Option 2.3</option>
</select>
</label>
</div>
</ion-content>
</ion-view>
答案 0 :(得分:0)
您的依赖关系不遵循命令。允许X
插件依赖于y
,因此应首先添加y
插件。所以可能的顺序是
<link href="css/style.css" rel="stylesheet">
<link href="css/jquery-ui.css" rel="stylesheet">
<link href="css/chosen.css" rel="stylesheet">
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<script src="js/jquery.js"></script>
<script src="js/jquery-ui.js"></script>
<script src="js/chosen.jquery.js"></script>
<script src="js/app.js"></script>
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="cordova.js"></script>
检查依赖关系以获取更多详细信息
答案 1 :(得分:0)