2012-04-19 59 views
0

我有一個iframe,需要根據運行時間如何根據內容大小使iframe縮小和排?

<iframe src='demo-frame.php' >Your browser doesn't support iFrames.</iframe> 

任何幫助的內容高度TI萎縮和成長?

+0

您可以添加更多的描述,您的問題?你的意思是iframe中的內容位於iframe的中間,而不是頂部? – Ryano 2012-04-19 14:51:33

+0

感謝Ryano的照顧,實際上我明白了,問題變得更加清晰,我需要讓它在運行時間縮小和輕鬆增長 – Med7at 2012-04-19 14:54:04

回答

0

也許試圖用jQuery的下面......

$('#iframeID').load(function() { 
    $(this).height($(this).contents().height()); 
    $(this).width($(this).contents().width()); 
});