2010-04-08 3 views
1

여기에 비슷한 문제가 있습니다 : Prior jQuery UI Dialogs become nonresponsive....여러 jQuery UI 대화 상자 및 하이퍼 링크 문제

다음은 문제의 원인입니다. 두 번째 대화 상자를 연 다음 두 번째 대화 상자를 닫은 다음 두 번째 대화 상자를 닫으면 첫 번째 대화 상자의 하이퍼 링크가 더 이상 작동하지 않습니다. 여기

는 대화 상자에 대한 코드입니다 :

<script type="text/javascript"> 
    $(function() 
    { 
     $("#PropertyDialog").dialog({ 
      autoOpen: false, 
      modal: true, 
      position: ['center',100], 
      resizable: false, 
      height: 'auto', 
      width: 700 
     }); 
    }); 
    function ShowPropertyDetailsDialog(strPropertyId) 
    { 
     // set the html of the div 
     LoadPropertyDialogHtml(strPropertyId); 

     // open the dialog 
     $('#PropertyDialog').dialog('open'); 
    } 
</script> 

<div id="PropertyDialog" title="Property Details"> 
</div> 

<script type="text/javascript"> 
    $(function() 
    { 
     $("#PropertyImageDialog").dialog({ 
      autoOpen: false, 
      modal: true, 
      position: ['center',75], 
      resizable: false, 
      height: 'auto', 
      width: 650 
     }); 
    }); 

    function ShowImageDialog(strTitle, strLinkUrl) 
    { 
     var dialogDiv = $get("PropertyImageDialog"); 
     dialogDiv.innerHTML = "<img src='" + strLinkUrl + "' alt='' width='600' />"; 

     $("#PropertyImageDialog").dialog"option","title",strTitle); 

     // open the dialog 
     $('#PropertyImageDialog').dialog('open'); 
    } 
</script> 

<div id="PropertyImageDialog" title="Property Image"> 
</div> 

LoadPropertyDialogHtml 기능은 ShowImageDialog의 처음 두 줄과 비슷한 않습니다 - PropertyDialog DIV의 내용을 설정합니다.

보통 링크의 경우 window.location을 사용하고 새 창 링크의 경우 window.open을 사용하여 링크 기능을 대체 할 수 있지만 작동하는 하이퍼 링크를 얻고 싶습니다. 왜 이런 일이 발생하는지 이해하고 싶습니다.

답변

0

이 대화 상단에 다른 DIVS가 있는지 빠르게 확인할 수 있습니까? 그것은 실제로 문제가 될 수 있습니다. 크롬에서 문제가되는 div를 마우스 오른쪽 버튼으로 클릭 한 다음 "inspect"하면 대화 상자 div가 아닌 오버레이를 강조 표시 한 다음 문제가됩니다.