添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Hi all.
I don't know which is the case if Safari supports .scrollHeight or not, but it doesn't behave properly on the page.
I have an IFRAME with source loaded dynamically
so on the source pages, there is a Javascript <body onLoad to resize the IFRAME that the page sits in:
topbox.height = topbox.contentWindow.document.body.scrollHeight+30
topbox is the IFRAME
A Mac user pointed out to me that in some cases the iframe goes completely flat (i assume, invisible at least) and in other cases the height is just way off.
Reading one article, I found that for Safari it should be .offsetHeight instead.
I have modified my code to read:
if (document.body.scrollHeight)
{topbox.height = topbox.contentWindow.document.body.scrollHeight+30}
{topbox.height = topbox.contentWindow.document.body.offsetHeight+30}
So if scrollheight is supported, it will do that, if not it tries with offsetHeight
But in Safari, I got the same results.
Anybody know what I have to do here?
Thanks Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.