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

编程入门 行业动态 更新时间:2024-10-28 20:21:16
如何在引导程序崩溃扩展时调用函数(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

更多推荐

本文发布于:2023-08-01 20:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1364859.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:时调   函数   程序   如何在   call

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!