Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2011
    Location
    Montreal
    Posts
    6
    Thanks
    1
    Thanked 1 Time in 1 Post

    Post iframe scroller position in main page

    Hi there!

    Here's the situation:
    I have an Iframe in the middle of a page (iframe id=myframe) on which is applied a script. The script auto-adjust its size according to the content. The height of the content is mostly longer than the main page (the one that contains the iframe), so I set the y-overflow visible.

    Here's the problem:
    The Iframe scrollbar cuts the page in half. I wished that the scrollbar would be at the very right of the page. Is there any way to move the scrollbar away from the iframe itself? Or would it be possible to set the iframe width to fit with the end of the page (so that the scrollbar is at the maximum right of the main page)?.

    Hope my question is clear... Here's a picture in case.
    http://postimage.org/image/2uv5m0l6s/
    Thank you in advance.

  • #2
    New to the CF scene
    Join Date
    Jun 2011
    Location
    Montreal
    Posts
    6
    Thanks
    1
    Thanked 1 Time in 1 Post
    I found the answer.
    Sorry, i wish i could delete the thread (also, not in the good category).

    I used this script :
    Code:
    <script type='text/javascript'>
    function iframer() 
    { 
    	// get width of #content 
    	frame_x = $('#content').width(); 
    	// get height of #menu 
    	frame_y = $('#menu').height(); 
    	
    	// apply height and width 
    	$('#iframe').css('width', frame_x); 
    	$('#iframe').css('height', frame_y); 
    } 
    
    $(document).ready( function() { iframer(); } );
    $(window).resize( function() { iframer(); } );
    </script>


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •