Click here to Skip to main content
15,894,106 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have main site A and i am loading site B in iframe under site A. but when site B loads under site A. It is showing two scrolls. when i remove scroll by no scrolling, its content become static and fixed sized. altought site B has much content to show.

What I have tried:

<iframe src="http://siteB.com" style="border: 0; position:absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%">




I also tried javascript code, but its not working in my case.


<iframe id='myFrame' 



frameborder=0 scrolling=no width=100%  



src="..."

    onload='adjustMyFrameSize

();'> 
</iframe> 



<script>
 function adjustMyFrameHeight()
    {
        var frame = getElement

("myFrame");
        var frameDoc = getIFrameDocument

("myFrame");
        frame.height = frameDoc.body.offsetHeight;
    }
</script>
Posted
Updated 3-Oct-18 0:39am

1 solution

Go to here: HTML iframe scrolling Attribute[^]

Note towards the bottom:

Syntax
<iframe scrolling="auto|yes|no">


Attribute   Values<pre>
Value       Description
auto        Scrollbars appear if needed (this is default)
yes         Scrollbars are always shown (even if they are not needed)
no          Scrollbars are never shown (even if they are needed)



So - behaving as expected.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900