Cutting some iframe src content

I want to display the contents of the page on my website using an iframe, but I want to “cut out” the part of the title (above), leaving my navigation bar, so the user can only see what is underneath it.

the code:

<div id="content"> <div style="height:800px;"> <iframe id="optomaFeed" src="http://www.optomausa.com/company/press-releases/" scrolling="auto" frameborder="0" height="100%" width="100%"></iframe> </div> </div> 

How can I do this? Tyvm ~

+6
source share
2 answers

I figured out how to do this using the css clip attribute:

 <div id="content"> <div style="height:800px;"> <iframe id="optomaFeed" src="http://www.optomausa.com/company/press-releases/" scrolling="no" frameborder="0" height="100%" width="100%" style="position:absolute; clip:rect(190px,1100px,800px,250px); top:-160px; left:-160px;"></iframe> </div> </div> 
+13
source

If the navigation bar container has an id , you can get a link to it in javascript and then call parentNode.removeChild() on it. This would mean that the navigation bar would probably flash for a second each time the page was resized in an iframe.

Alternatively, you can pass the iframe load through a server-side script that loads it, crosses out the HTML for the navigation bar, and then displays the result. This will probably slow down the user’s interaction with the page, as this will mean that everything effectively requires downloading twice. If you intend to use this approach, you probably need to add the <base> tag so that you don't break CSS / JS.

0
source

Source: https://habr.com/ru/post/895811/


All Articles