admin管理员组文章数量:1291085
I have a confirmation dialog in jquery that pops up and show some confirmation details. What I'm trying to do is that if the user clicks YES, I want to use THE SAME confirmation dialog box but with a smaller text like "Please wait..." or something. For that, I would want to ajust my dialog dimensions accordingly (meaning, after the user clicks YES, I want my dialog to be smaller since there will only be a small text inside of it). How do I achieve something like this? How do I change the size of my dialog after the user has clicked YES?
Also, I know in javascript confirmation box, if the user clicks OK, TRUE is return, else false is return. Is it the same for jquery modal confirmation boxex? How do I know if the user hit YES or CANCEL?
Thank you
I have a confirmation dialog in jquery that pops up and show some confirmation details. What I'm trying to do is that if the user clicks YES, I want to use THE SAME confirmation dialog box but with a smaller text like "Please wait..." or something. For that, I would want to ajust my dialog dimensions accordingly (meaning, after the user clicks YES, I want my dialog to be smaller since there will only be a small text inside of it). How do I achieve something like this? How do I change the size of my dialog after the user has clicked YES?
Also, I know in javascript confirmation box, if the user clicks OK, TRUE is return, else false is return. Is it the same for jquery modal confirmation boxex? How do I know if the user hit YES or CANCEL?
Thank you
Share Improve this question asked Mar 6, 2012 at 5:15 user765368user765368 20.4k27 gold badges101 silver badges171 bronze badges1 Answer
Reset to default 8I think this is what you are looking for. You can change the height of your confirmation box:
$( "#dialog-confirm" ).dialog({
width : 100,
height:100
});
And can add buttons to it and track the clicks:
$( "#dialog-confirm" ).dialog({
width : 100,
height:100,
modal: true,
buttons: {
"Ok": function() {
alert('ok');
$( this ).dialog( "close" );
},
Cancel: function() {
alert('cancel');
$( this ).dialog( "close" );
}
}
});
In addition to it, the documentation is way too in detail here. http://jqueryui./demos/dialog/
Demo : http://jsfiddle/zgN2X/2/
本文标签: javascriptchange size of jquery modal confirmation dialogStack Overflow
版权声明:本文标题:javascript - change size of jquery modal confirmation dialog - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741514366a2382794.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论