Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
103
rated 0 times [  110] [ 7]  / answers: 1 / hits: 19833  / 12 Years ago, sun, april 15, 2012, 12:00:00

jsFiddle for this question



I am currently using bootstrap modal, which is a jQuery plugin to create a popup box. (If anyone wants to check out the very short documentation, here is a link to it - it's very short, so only takes a minute).



Unfortunately, I am having a couple problems:




  1. I need to be able to define the size of the modal pop-up box. I tried the following, but it does not display correctly:



    <div class=modal id=myModal style=width: 800px; height: 900px;>


  2. I need to be able to hide the modal by default. Currently, it displays as soon as the page loads. I tried the following, but it does not seem to hide correctly:



    $(document).ready(function() { $('#myModal').modal(hide); });




Any idea how I might be able to resolve these issues?


More From » jquery

 Answers
29

Answer 1: Try defining the modal CSS class and set the width and height.
Answer 2: when calling the modal function, pass in an option object with th property show as false.



$(#myModal).modal({show: false});


Answer 3: you can handle the shown event and wire it up to make an AJAX call to web page and set the result as the inner HTML of the div.


[#86234] Friday, April 13, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bryantc

Total Points: 455
Total Questions: 96
Total Answers: 110

Location: San Marino
Member since Thu, Jun 30, 2022
2 Years ago
bryantc questions
Fri, Aug 13, 21, 00:00, 3 Years ago
Tue, Mar 30, 21, 00:00, 3 Years ago
Fri, Jun 5, 20, 00:00, 4 Years ago
Wed, May 27, 20, 00:00, 4 Years ago
;