jsFiddle for this question
I am currently using bootstrap modal, which is a jQuery plugin to create a popup. (If someone wants to check out a very short documentation, here is the link - it is very short, so it only takes a minute).
Unfortunately, I have a couple of problems:
I need to determine the size of a modal popup. I tried the following, but it does not display correctly:
<div class="modal" id="myModal" style="width: 800px; height: 900px;">
I need to be able to hide the modal file by default. It is currently displayed as soon as the page loads. I tried the following, but it did not seem to hide correctly:
$(document).ready(function() { $('#myModal').modal("hide"); });
How can I solve these problems?
Answer 1: Try defining a CSS modal class and set the width and height. Answer 2: when calling a modal function, pass the option object with the property type "show" as false.
$("#myModal").modal({show: false});
Answer 3: you can handle the βshownβ event and hook it in to make an AJAX call to a web page and set the result as an internal HTML div file.
Try the following in the source. Worked for me.
$('#ModalForm').dialog( { modal : true , autoOpen : false , height : 300, width : 400, . . . .
, , , $('#myModal').modal({'show':false}), .
$('#myModal').modal({'show':false})
- iframe html ajax. , javascript div, . , .
, , $('#myModal').modal({'show':false).height('600px').width('500px');β
$('#myModal').modal({'show':false).height('600px').width('500px');β
<div class="modal" id="myModal" style="width:800px;height:900px;display:none;">
.hide , , . , , , , , .
.hide
, :
<div class="modal hide fade custom-size" id="myModal"> ... </div>
.. .fade fade/slide, , , .
.fade
, , , , , , , " ".
, float:center ( , ): http://jsfiddle.net/zkzuM/2/, -: http://jsfiddle.net/zkzuM/2/show/
float:center
#myModal{ height:200px; width:100px; }
- css
javascript
$('#myModal').modal({'show':false});
fiddle .
.modal-body class 400px. , 900 , .modal-body. .
#myModal .modal-body { height: 775px; max-height: 800px; }
775px 900px high #myModal - paddings box. 125px . , - :
$('#myModal .modal-body').height($('#myModal').height()-125);
, bootstrap CSS, max-width .
JS, , hide .