On the page there are 2 iframe.

<body> <iframe id="play" class="menu-frame" src="menu.php" frameborder="0" allowtransparency="true" scrolling="no"></iframe> <iframe id="cont" class="cont-frame" src="/page_1.html" frameborder="0" style="position: absolute; height: 100%; border: none" allowtransparency="true" ></iframe> </body> 

In the first - the player, in the second - the contents. Player in the upper right corner. But when scrolling through the main page, it should move up, along with the content, and now it is actually fixed and always at the top. In general, it is necessary that it behaves not like an iframе , but like a normal relative block on a page, while being in an iframe . Is it possible to somehow overcome it, provided that iframe is still two?

one

  • @andreymal difficulty is that the page reloads and the player continues to play. And ajax `th already impossible. So you have to get out that in one frame there is content, and you can follow links in it, and in the second one the player itself, which does not depend on the content. - Dmitry N
  • Comments are not intended for extended discussion; conversation moved to chat . - Nicolas Chabanovsky

1 answer 1

You have in the example code and in the description 2 of the frame next, and in the picture one and the frame in another. I propose to consider an example written according to your description and clarify what you had in mind: https://jsfiddle.net/vdwLh7yy/

html

 <iframe id="play" class="menu-frame" src="http://ya.ru/nopagefortest" frameborder="0" allowtransparency="true" scrolling="no"></iframe> <iframe id="cont" class="cont-frame" src="http://ya.ru/nopagefortest" frameborder="0" style="position: absolute; height: 100%; border: none" allowtransparency="true" ></iframe> 

css

 .menu-frame { border: 1px solid #00f; width: 100px; height: 25px; float: right; } .cont-frame {border: 1px solid #f00 !important;} 
  • one in the other because <iframe id = "play"> position: absolute. I duplicate, the idea is that the page reloads, and the player continues to play. You can't do ajax. So you have to get out that in one frame there is content, and you can follow links in it, and in the second one the player itself, which does not depend on the content. - Dmitry N