Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-26-2011, 11:27 PM   PM User | #1
cuckoo
New to the CF scene

 
Join Date: Jun 2011
Location: Montreal
Posts: 6
Thanks: 1
Thanked 1 Time in 1 Post
cuckoo is an unknown quantity at this point
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.
cuckoo is offline   Reply With Quote
Old 06-27-2011, 05:05 AM   PM User | #2
cuckoo
New to the CF scene

 
Join Date: Jun 2011
Location: Montreal
Posts: 6
Thanks: 1
Thanked 1 Time in 1 Post
cuckoo is an unknown quantity at this point
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>
cuckoo is offline   Reply With Quote
Reply

Bookmarks

Tags
iframe, position, scroll bar

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:31 PM.


Advertisement
Log in to turn off these ads.