Make iframes content overflow outside iframe extents

后端 未结 3 1321
灰色年华
灰色年华 2021-02-19 06:50

I have a webpage that contains an iframe. Inside that iframe is an embedded Youtube video. When I play this video I make it scale up (grow) in size. As

3条回答
  •  旧巷少年郎
    2021-02-19 07:16

    [updated and Edited]

    window.open works fine for IE ( as in window.open('iframe.html','','fullscreen=1,channelmode=1'); but I want to find a proper way for IE so that it doesn't reload the contents as I did for the others) but I found you a better way that works on chrome, safari and FF since they don't support theater mode,

    your iframe should be like :

    
    

    this is the content page of your iframe:

    
    
    
    
    
    
    
    
    

    you can supply that with css to correct the containers height and width, using classes (addClass and removeClass) when maximized or minimized/closed (style added to the code)

    IE compatibility function is on the way ..

    EDIT: maybe you should look at the problem from another angle if you don't want to use windows or fullscreen.

    the solution would be discarding the iframe which is restricting the accessibility and replacing it with a div that has css overflow:hidden and then populate this div with your iframe page's contents (you can use ajax or any other method to load the contents). tada, you have something like an iframe but it is an element of the same document. then, you can control the overflow in two ways:

    1- toggle the container's css between overflow:hidden and visible or auto.

    2- relocate the element outside the container div and use absolute positioning to show it over other elements.

    note: don't be afraid of losing the scroll bar, you can build your own or just link your top css of the contents with the jquery ui slider's value with absolute content's positioning and you are good to go.

提交回复
热议问题