引导程序崩溃扩展时如何调用函数 [英] How do I call a function when bootstrap collapse expands

查看:73
本文介绍了引导程序崩溃扩展时如何调用函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要激活此javascript:

I want to activate this javascript:

jsPlumb.repaintEverything();

...并打开一个警告框,上面写着我正在扩大!!!"当用户单击> 此小提琴

...and fire up an alert box saying "I'm expanding!!!" when a user clicks the button in this fiddle

有人知道如何实现这一目标吗?

Does anyone know how to achieve this?

推荐答案

您可以使用Bootstrap引发的shown.bs.collapse事件:

You can use the shown.bs.collapse event that Bootstrap raises:

$('#demo').on('shown.bs.collapse', function() {
    jsPlumb.repaintEverything();
});

更新了小提琴

请注意,元素展开动画完成后,会在 后触发此事件.如果要在动画开始时运行代码,请改用show.bs.collapse

Note that this event fires after the element expansion animation has completed. If you want to run the code as the animation starts, use show.bs.collapse instead

这篇关于引导程序崩溃扩展时如何调用函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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