Jquery 手风琴更改事件不会触发 [英] Jquery accordion change event doesn't fire

查看:30
本文介绍了Jquery 手风琴更改事件不会触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这不起作用:

<html xmlns="http://www.w3.org/1999/xhtml"><头><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").手风琴({更改:功能(事件,用户界面){警报('测试');}});});<身体><div id="手风琴"><h2><a href="#">Header1</a></h2><div><p>内容1</p>

<h2><a href="#">Header2</a></h2><div><p>内容2</p>

解决方案

您是否确保并包含对 jQuery 图书馆?

试试这个

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.js'></脚本>

This doesn't work:

<!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>

解决方案

Did you make sure and include the proper reference to the jQuery library?

try with this

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.js'></script>

这篇关于Jquery 手风琴更改事件不会触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
前端开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆