admin管理员组文章数量:1356960
I'm trying to implement a zoom out animation on hide(), based on the answer on the github repo of bootstrap-modal (using Bootstrap 2.3.2).
The idea is to add a CSS transition, and intercept the hide
event, something like:
$modal.on('hide', function () {
$modal.css({top: 0, left: 0, transform: 'scale(0.1, 0.1)'});
// return false; // unment this line to see zoom out
});
The problem is that the modal is hidden before there's a chance to see the animation. Returning false
shows the animation, but keeps the modal box from pleting the hiding.
How can I plete the hide process but still see the animation?
See fiddle at /
TIA
I'm trying to implement a zoom out animation on hide(), based on the answer on the github repo of bootstrap-modal (using Bootstrap 2.3.2).
The idea is to add a CSS transition, and intercept the hide
event, something like:
$modal.on('hide', function () {
$modal.css({top: 0, left: 0, transform: 'scale(0.1, 0.1)'});
// return false; // unment this line to see zoom out
});
The problem is that the modal is hidden before there's a chance to see the animation. Returning false
shows the animation, but keeps the modal box from pleting the hiding.
How can I plete the hide process but still see the animation?
See fiddle at http://jsfiddle/dtyohc28/5/
TIA
Share Improve this question edited Jan 27, 2019 at 4:03 isapir asked Mar 31, 2015 at 0:51 isapirisapir 23.7k16 gold badges125 silver badges121 bronze badges2 Answers
Reset to default 5A little hacky but works. http://jsfiddle/dtyohc28/7/
$modal.on('hide', function () {
$modal.css({top: 0, left: 0, transform: 'scale(0.1, 0.1)'});
if($modal.css('top')!="0px"){
setTimeout(function(){
$modal.modal('hide');
}, 750);
return false;
}
});
http://jsfiddle/dtyohc28/6/ Try this, instead of using on('hide'), make your own function to control it.
$('#dismissModal').click(function(){
$modal.css({top: 0, left: 0, transform: 'scale(0.1, 0.1)', opacity:'0'});
setTimeout(function(){
$('.modal').modal('hide')
},750);
});
本文标签: javascriptBootstrap Modal zoom out animationStack Overflow
版权声明:本文标题:javascript - Bootstrap Modal zoom out animation - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744065095a2584842.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论