Jquery手风琴改变事件不起火 [英] Jquery accordion change event doesn't fire
本文介绍了Jquery手风琴改变事件不起火的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这不起作用:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="css/smoothness/jquery-ui-1.10.1.custom.css" />
<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.10.1.custom.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#accordion").accordion({
change: function (event, ui) { alert('test'); }
});
});
</script>
</head>
<body>
<div id="accordion">
<h2><a href="#">Header1</a></h2>
<div>
<p>content 1</p>
</div>
<h2><a href="#">Header2</a></h2>
<div>
<p>content 2</p>
</div>
</div>
</body>
</html>
推荐答案
你确定并包括适当的参考 jQuery 库?
Did you make sure and include the proper reference to the jQuery library?
尝试使用此
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.js'></script>
这篇关于Jquery手风琴改变事件不起火的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文