iframe 呼叫父視窗動態更新高度

iframe要善用,如果是網頁有內容要給搜尋引擎收集時

使用iframe時,搜尋引擎會忽略掉iframe裡面的資訊

但是如果在開發系統時使用到iframe的功能時,有時蠻方面的

但是有一個問題,如果iframe網頁內容變動時,就會在使用iframe的父網頁裡產生Scrobar

這樣就會使操作變得不方面

那應該怎麼處理呢?

父視窗:

// 根據iframe的內容高度自動調整iframe的高度
function autoHight(){

...

}

子網頁:

$(document).ready(function () {
//網頁載入完成後,再呼叫一次高度調整函數
parent.autoHight();

}

 

2 則迴響於《iframe 呼叫父視窗動態更新高度

  1. Please let me know if you’re looking for a author for your site. You have some really great articles and I feel I would be a good asset. If you ever want to take some of the load off, I’d really like to write some material for your blog in exchange for a link back to mine. Please send me an email if interested. Thanks!

  2. Hi would you mind letting me know which hosting company you’re using? I’ve loaded your blog in 3 completely different internet browsers and I must say this blog loads a lot quicker then most. Can you recommend a good web hosting provider at a honest price? Many thanks, I appreciate it!