2010-04-08 30 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?這實際上可能是一個問題。在chrome中,右鍵單擊>「檢查」問題div,然後突出顯示覆蓋/不是對話div的東西,那就是問題所在。