Search code examples
jquerysimplemodal

how use scroll with simpleModal plugin


I'm using simpleModal plugin http://www.ericmmartin.com/projects/simplemodal/ when the text in the dialog is too long, I try to scroll, but the entire page is scrolling, even when using modal:true.

so I can't see the end of the dialog , I try define maxHeight - but seem with no effect.

any idea?

code:

 function loadDialog(Code,vrsnNum)
 {
  vrsnNum=vrsnNum-1;
  $.get(
   "/ajaxVerision.asp", 
   {Code: Code,VerisionNum: vrsnNum},
    function(data)
     {
     $(".CrnrPager").html(data);
     }
    );

  $.get(
   "/ajaxVerisionNext.asp", 
   {Code: Code,VerisionNum: vrsnNum},
    function(data)
      {
      $("#sp1").html(data);
      }
   );

  $('#basic-modal-content').modal({maxHeight: 400,autoPosition : true, position: ['20%','25%']});
 }

Solution

  • You could try to assign some CSS to the modal() call, something like this:

    $('#basic-modal-content').modal({
        maxHeight: 400,
        autoPosition: true,
        containerCss: {
            'maxHeight' : '400px',
            'overflow' : 'auto'
        },
        position: ['20%', '25%']
    });
    

    In addition you also have the dataCss property available.