0
有誰知道如何實現下面的JavaScript過程? 我使用colorbox來顯示iframe。想關閉它後重定向到colorbox iframe中的另一個頁面
- 我設置了colorbox iframe上的橫幅鏈接。
- 我希望這個iframe在點擊橫幅時關閉,之後我希望父窗口重定向到另一個頁面。
以下2碼是什麼I`ve嘗試:
1
<div>
<a href='#' onclick='parent.$.colorbox.close();linkto();'>
<img src="../images/test.png" alt=「#」 >
</a>
<script>
function linkto() {
location.href = "https://www.test.com";
}
</script>
</div>
2
<div>
<a href='#' onclick='parent.$.colorbox.close(); window.location.href ='https://www.test.com;'>
<img src="../images/test.png" alt=「#」 >
</a>
</div>
謝謝你的偉大的答案! – yusaw
我會盡快嘗試:) – yusaw
謝謝你的幫助亞歷山大,我已經證實它進展順利:) – yusaw