2015-06-03 31 views
1

HTML內容的fancybox表示從HREF

<table> 
    <tr> 
    <td>1</td> 
    <td>CountryName</td> 
    <td> 
     <div class="action"> 
     <a class="edit-country" href="/Edit-Country?countryId=1"></a> 
     <a class="delete-country" href="/Delete-Country?countryId=1"></a> 
     </div> 
    </td> 
    </tr> 
</table> 

腳本

$(".edit-country").fancybox({ 
    type: "inline", 
    modal: true, 
    closeBtn: false, 
    helpers: { 
      title: null 
    } 
}); 

我想,如果我在Edit點擊它會打開它獲取由href內容的彈出。但它把我帶到另一個頁面。

如果我使用type='ajax'但它沒有初始化document.ready方法Edit-Country頁面,它將在同一頁面打開。

有什麼辦法可以在同一頁面打開並且初始化document.ready方法Edit-Country頁面?

回答

2

當你使用不同的頁面時,你需要設置類型爲'iframe'。當你想在彈出的窗口顯示來自像DIV /面板內頁使用 直列

$(".edit-country").fancybox({ 
type: "iframe", 
modal: true, 
closeBtn: false, 
helpers: { 
     title: null 
} 
}); 

http://fancybox.net/api