[英]JQuery Accordion not working when code seems alright
我的代碼:
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel='stylesheet' type='text/css' href='http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css'/>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.10.2.js'></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
<script>
$(document).ready(function(){
$("#menu").accordion();
});
</script>
</head>
<body>
<div id="menu">
<h3>Section 1</h3>
<div>
<p>I'm the first section!</p>
</div>
<h3>Sectio 2</h3>
<div>
<p>Tab 2</p>
</div>
<h3>Section 3</h3>
<div>
<p>Tab 3</p>
</div>
</div>
</body>
</html>
我已經嘗試了好幾次,但是該頁面無法在Google Chrome中正常顯示。請有人幫我。
在您的jQuery UI鏈接中添加http
:
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
由於庫未正確加載而引發錯誤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.