如何在引导程序崩溃扩展时调用函数(How do I call a function when bootstrap collapse expands)
我想激活这个javascript:
jsPlumb.repaintEverything();......然后点开一个警告框,上面写着“我正在扩张!” 当用户点击这个小提琴中的按钮时
有谁知道如何实现这一目标?
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事件:
$('#demo').on('shown.bs.collapse', function() { jsPlumb.repaintEverything(); });更新小提琴
请注意,此事件在元素扩展动画完成后触发。 如果要在动画开始时运行代码,请改用show.bs.collapse
You can use the shown.bs.collapse event that Bootstrap raises:
$('#demo').on('shown.bs.collapse', function() { jsPlumb.repaintEverything(); });Updated fiddle
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
更多推荐
发布评论