问题
I would like to add a scrollbar when the contents of the iframe is too large and does not appear.
I am trying the following:
parent.iframepage.style.height = "350px"; parent.iframepage.style.width = "500px"; parent.iframepage.contentarea.style.height = "350px"; parent.iframepage.contentarea.style.width = "500px"; parent.iframepage.contentarea.style.overflow = "visible";any help please?
回答1:
Surely the correct syntax would be ...
parent.iframepage.style.overflow = "auto";
I'd recommend doing it in the stylesheet.
iframe
{
overflow: auto;
}
You should qualify it better, with an ID, class or such.
回答2:
You can modify the content of the iframe only if it is from the same domain as the parent document.
来源:https://stackoverflow.com/questions/5104586/scrollbar-iframe-in-javascript