admin管理员组文章数量:1405103
My website uses data-remote
on a bootstrap modal to load images. You can see the code in this question () which I answered myself. The thing is that it might take a second or two to load the info so I would like to add a loading image (preferably the one used in fancybox). Im not 100% sure how to do this. It might be to add the image and when modal-open
loads then remove the image. Im not 100% sure on how to do this and any help will be great! Thanks!
My website uses data-remote
on a bootstrap modal to load images. You can see the code in this question (https://stackoverflow./a/21199283/2537559) which I answered myself. The thing is that it might take a second or two to load the info so I would like to add a loading image (preferably the one used in fancybox). Im not 100% sure how to do this. It might be to add the image and when modal-open
loads then remove the image. Im not 100% sure on how to do this and any help will be great! Thanks!
2 Answers
Reset to default 4 +50According to the docs, you can use the event listeners:
show.bs.modal
and shown.bs.modal
$(function()
{
$(".modal").on("show.bs.modal",function()
{
// add loader indicator
});
$(".modal").on("shown.bs.modal",function()
{
// remove loader indicator
});
}
Your own answer to your other question does not have any javascript. So it's difficult to provide an answer that can be integrated into your current solution.
A loaded.bs.modal
event will be present in Bootstrap v3.1.0 (see https://github./twbs/bootstrap/issues/10911); listening for this event is preferable to listening to shown.bs.modal
.
本文标签: javascriptBootstrap 3 Modal dataremote loading imageStack Overflow
版权声明:本文标题:javascript - Bootstrap 3 Modal: `data-remote` loading image - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744886611a2630524.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论