2009-11-11 11 views
1

일부 HTML을 표시하기 위해 simplemodal jquery 플러그인을 사용하고 싶습니다. 이 html에는 아약스 버튼이 있습니다.이 버튼을 누르면 더 넓은 HTML 컨텐트가 모달 상자로 반환됩니다.simplemodal, 닫은 후 즉시 다시 엽니 다.

Simplemodal이이를 "인식"하고 자동 크기 조정하도록하는 방법이없는 것처럼 보입니다. 따라서 저는 Ajax 버튼을 눌렀을 때 모달을 죽인 다음에 다시 만들고 싶습니다. 내용은 돌려 보내지고 inital autosize는 그것을 취급하게했다. 그러나 나는이 작품을 만드는 방법을 알아낼 수 없습니다.

$('#Element input.Ajax').click(function (e) { 

//Get Ajax content and return to div 

$.modal.close(); 

$('#Element').modal(
       { 
       onOpen: function (dialog) 
       { 
       dialog.overlay.fadeIn('slow', function() 
        {dialog.data.hide(); 
        dialog.container.fadeIn('slow', function() 
         {dialog.data.slideDown('slow');}); 
        }); 
       }, 
      onClose: function (dialog) 
       { 
       dialog.data.fadeOut('slow', function() 
        { 
        dialog.container.hide('slow', function() 
         { 
         dialog.overlay.fadeOut('slow', function() 
          {$.modal.close();}); 
         }); 
        }); 
       }, 
      overlayClose:true, 
      opacity: 75, 
       }); 

을하지만이 모든 코드 수행을 재개하지 않고 오버레이 가까이 :

지금까지 내가 가지고있다.

답변

0

새 데이터의 크기를 결정하고 이에 따라 컨테이너의 크기를 조정할 수도 있습니다. 도움이

// inside the onShow callback for the first modal, bind the click event 
onShow: function (dialog) { 
    $('#Element input.Ajax', dialog.container[0]).click(function (e) { 
     $("#new-modal").load("page.html", function() { 
      $("#new-modal").modal({ 
       // your options 
      }); 
     }); 
    }); 
} 

희망 :

그러나, 당신의 방법에 따라, 당신은 뭔가를 할 수 있습니다.

-eric

관련 문제