JQuery-Mobile 可折叠展开/折叠事件 [英] JQuery-Mobile collapsible expand/collapse event

查看:23
本文介绍了JQuery-Mobile 可折叠展开/折叠事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了标题的 onclick 事件之外,有没有人知道任何其他方法来捕获用 data-role="collapsible" 标记的组件展开或折叠的事件?

Does anyone know any other way to capture the event of expanding or collapsing a component marked with data-role="collapsible" apart from the onclick event of its header?

我想要某种事件,它也将提供有关组件展开/折叠状态的信息.

I would like some kind of event that will also provide information about the expanded/collapsed state of the component.

推荐答案

collapsible 块有自定义事件.您可以绑定到 expandcollapse 事件:

There are custom events for the collapsible blocks. You can bind to the expand and collapse events:

$('#my-collapsible').bind('expand', function () {
    alert('Expanded');
}).bind('collapse', function () {
    alert('Collapsed');
});

这是一个jsfiddle:http://jsfiddle.net/6txWy/

Here is a jsfiddle: http://jsfiddle.net/6txWy/

这篇关于JQuery-Mobile 可折叠展开/折叠事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆