当我尝试点击链接时,手风琴无效。以下是我的内容页面链接。
<script src="accordion/jquery.accordion.source.js" type="text/javascript" charset="utf-8"></script>
在母版页中我使用了以下脚本链接。
<link href="accordion/styles.css" rel="stylesheet" type="text/css" />
<script src="accordion/dependencies/jquery-1.3.2.js" type="text/javascript" charset="utf-8"></script>
<script src="accordion/jquery.accordion.source.js" type="text/javascript" charset="utf-8"></script>
ASP.NET HTML设计:
<ul class="accordion">
<li><a href="#one">example1</a>
<div>....</div>
</li>
<li><a href="#two">example2</a>
<div>....</div>
</li>
<li><a href="#three">example3</a>
<div>....</div>
</li>
</ul>
<script type="text/javascript">
$(document).ready(function () {
$('ul').accordion();
});
</script>
答案 0 :(得分:1)
您的代码无效,因为您没有导入jQuery UI 。
<ul class="accordion">
<li><a href="#one">example1</a>
<div>....</div>
</li>
<li><a href="#two">example2</a>
<div>....</div>
</li>
<li><a href="#three">example3</a>
<div>....</div>
</li>
</ul>
<script src="http://code.jquery.com/jquery-1.11.3.js"></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
<script>
$( ".accordion" ).accordion();
</script>