scrollbar iframe in javascript

瘦欲@ 提交于 2019-12-12 06:31:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!