There is site # 1 (mine) and there is site # 2 (not mine).

An example of the content of the first site:

<div class="header"><a href="/сайт№2">Личный кабинет</a></div> <div class="main"></div> <div class="footer"></div> 

An example of the content of the second site (in which code I do not have access):

 <div class="logo"></div> <div class="form"></div> 

Essence: It is necessary when clicking on the link "My Account" to open the site number 2 while removing from it the class="logo"

How I see it:

  1. Click "My Account"
  2. A small window opens (blank?) With <div class="form"> (iframe?)

How to implement it at all? Tell me please.

Here is the idea. In the iframe you can hide the scroll. Is it possible to stop the iframe scroll in the right place using JS and then hide it?

    2 answers 2

    Here is an approximate solution that was required:

     #outerdiv { width:756px; height:496px; overflow:hidden; position:relative; } #innerIframe { position:absolute; top:-546px; left:-349px; width:1280px; height:1200px; } 
     <div id='outerdiv'> <iframe src="http://www.intellicast.com/National/Radar/Current.aspx?location=USNY0850&animate=true" id='innerIframe' scrolling=no></iframe> </div> 

    But not final. Because in my case there will be a login and password form that should be thrown from the iframe to a new tab, and not remain in the window.

      You can open another site in the iframe. But you cannot influence the styles and DOM of the site in the iframe. The ban was introduced for security purposes, in particular to combat phishing.

      That is, if you do not have access to the site code number 2, then you cannot change anything in it - just open it in a new tab or in an iframe.

      I will reveal the idea from the comments - scroll the document in the iframe to some place and then hide the scroll. You can actually scroll, like this code in js:

       var myIframe = document.getElementById('iframe'); myIframe.onload = function () { myIframe.contentWindow.scrollTo(xcoord,ycoord); } 

      But this is only possible if page # 2 inside the iframe is on the same domain as your page # 1. If the page of another site opens inside the iframe, the browser will not allow you to influence it in any way through js - this is another prohibition for security reasons.

      • It goes without saying. Just maybe using JS on the client side can you cut the class? JS and iframe with site # 2 will be on site # 1 the same. Any crutch is very necessary. - Sergey
      • one
        Here is the idea. In the iframe you can hide the scroll. Is it possible to stop the iframe scroll in the right place using JS and then hide it? - Sergey
      • You can do that. But only if both pages are on the same domain. In your case, as I understand it, this is not the case, so an attempt to scroll, or in any other way affect the document in the iframe, will cause an error accessing the foreign domain via js. - Vitaly Emelyantsev
      • one
        Solved the issue with regular CSS. Snatched the desired part, and banned the scroll. - Sergey
      • Can you share the solution? After some time you will be able to answer your own question, describe your solution there? - Vitaly Emelyantsev