Search code examples
jqueryajaxsimplemodal

re-init simplemodal


regarding this jquery plugin http://www.ericmmartin.com/simplemodal-1-4-3-released/

I have an ajax function which takes a little while to get the data - so i want to open the modal div with a spinner

$("#basic-modal-content").modal(); 
$("#basic-modal-content").html('<img src="ajax_loader.gif" width=100>');

within the ajax call at the end in the success function, I make this

$('#basic-modal-content').empty();
$('#basic-modal-content').html('<div class="content-center">'+title+'</div>');
$("#basic-modal-content").modal(); 

this results in 1. popup open with spinner - thats ok 2. the basic-modal-content div gets empty 3. the new content get loaded 4. the content is much to long for the div

normally with the first modal call, the content is ewithin the div with a scrollbar.

so, is tehre any option I can re-initialisate the modal call?

thanks Adrian


Solution

  • I simply went to the demopage and tried to reproduce the problem, and ofcourse try to find the problem and fix it.

    Reproducing was just making the content to be 2000px high.

    The following worked for me in this particular case:

    overflow: auto;