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

查看:100
本文介绍了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天全站免登陆