将网站嵌入到iframe中并隐藏某些元素 [英] Embed website in an iframe and hide certain elements

查看:931
本文介绍了将网站嵌入到iframe中并隐藏某些元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



基本上将它插入到 iframe中

code>。但他们希望网站上的某些通常可见的元素不会出现在嵌入式版本上。



有没有办法将网站嵌入到 iframe 中并使用 css code>来隐藏特定的 div id来达到这个目的吗?

解决方案

您可以在java脚本中使用以下代码来管理iframe的元素

  frame.contentWindow.document.getElementById或
frame.contentDocument.getElementById


I have a client that wants to be able to embed their website into their distributors websites.

Basically inserting it in an iframe. But they want certain elements of their website that are normally visible to not appear on the embedded version.

Is there a way to embed a website in an iframe and use css to hide specific div id's to achieve this?

解决方案

you can use following code in java script to manage element of a iframe

frame.contentWindow.document.getElementById or
frame.contentDocument.getElementById

这篇关于将网站嵌入到iframe中并隐藏某些元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆