Closed (fixed)
Project:
insertFrame
Version:
6.x-2.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Issue tags:
Reporter:
Created:
31 Jan 2009 at 12:07 UTC
Updated:
22 Oct 2009 at 21:57 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
MarcElbichon commentedYou can't.
The only way is to include in the iframe page a function to resize parent.getElementById('iframeid') size.
Comment #2
giorgoskMarc
we can put the following code as you say inside the iframe content (iframe src page)
and it works perfectly when both src page is on the SAME DOMAIN
but it give "access denied" when src page is on a DIFFERENT domain
as I suspected its a SECURITY RISK for both the iframe and the iframe src to be able to manipulate one another ...
--------------------------------------
I was thinking of another possible workaround
Having a javascript function increase the Height of the "iframe" untill the scrollbars dissapear but I can't find a way to check if/when scrollbars are visible or not. Any ideas ?
Comment #3
MarcElbichon commentedAs you said, security does not accept access to page in differents domains. So your suggestion to increase height will not work as you need to access to parent page to do this !!!
No other idea !!!
Comment #4
giorgoskMaybe I don't understand you but maybe I was not clear enough on the previous post
I can actually do it with the following example
I incrementally increase the iframe height until the scrollbars dissappear
and all is done from within the CALLING page (so no external domain is involved)
BUT I don't know how to check if the scrollbars are not visible
Comment #5
MarcElbichon commentedPerhaps with this (http://geekswithblogs.net/rashid/archive/2007/01/13/103518.aspx)
Comment #6
giorgoskMarc
I have hacked your module in such a way that other people might find useful, thus I am proposing a feature request
When the url is EXTERNAL one can put an extra attribute for your iframe filter (external=yes) to tell it that the URL is external and that regular javascript WON'T WORK and another one to tell it the combined height of header + footer (headerandfooterheight=150)
With this information my code can assign a height to the
iframe = window.height - headerandfooterheightthus creating a page with no window scrollbars but only iframe scrollbars (which is less confusing to the user)and here is how I did it (but don't know enough to create a patch)
add in adjustHeight.js
add this in insertframe.module
ofcourse it might need some beautifying but it works and it even adjust the height of the iframe on window.resize
Hope it makes sense
Comment #7
MarcElbichon commentedWhy don't you use height and scrolling properties ?
ie:
[[[www.drupal.org height=300px scrolling=auto]]]
Comment #8
giorgoskI thought it was clear but here is an attempt to clear things
If you set the height to a small number then you might be loosing space on
tall screens (and it looks bad), if you set the height large then you get the
following problem:
you get 2 sets of scrollbars (the iframe + the window scrollbars)
thus it is a usability issue where the user has to
move the window scrollbar AND THEN the iframe scrollbar in order to
see something at the bottom of the iframe content !!!!!!!!!
With my solution the iframe get the height of the window (-header -footer heights)
thus Eliminating the window scrollbars ..... (one set of scrollbars)
Take a look at the attached screenshot (2 sets of scrollbars)
Here is where I have implemented this solution http://www.myhellas.com/flights
and you can see the problem LIVE (if you disable javascript, and make your viewport smaller than 500px)
Hope it makes more sense Now
Comment #9
MarcElbichon commentedYour site works with FireFox but not with IE 6 (see screenshot)
Thus, this works because your iframe's height is smaller than window's height. If you have a left or right pane greater than window's height, you'll see two scrollbars.
In you code, you only manage resizing of the browser window. Your iframe's height is fixed to a size. Could you post me your iframe filter code in the drupal page ( the [[[.....]]] code) ?
I think the better way is to set height and scrolling properties. I can add a "resize" property to manage resizing of the iframe according to browser resizing. What do you think of ?
Comment #10
giorgoskDon't take into consideration IE6 in order to judge the code (I should have told you before I guess)
The site has a known issue with IE6 - the problem is the theme/template and it will be fixed soon
but the javascript code works PERFECT in ALL other MODERN browsers (IE6 is not exactly MODERN)
I am resizing the IFRAME HEIGHT ONLY but not the browser window, revisit the code please.
This is what I am using in the node
still specifying the height just in case javascript is disabled.
I don't completely understand this part but maybe we are talking about the same thing.
The height and scrolling are still specified in my scenario just in case javascript is disabled.
Comment #11
MarcElbichon commentedI think this is a specific feature. What I suggest you, is to add theming functions to do what you want.
With the attached version, you can do this.
Comment #12
giorgoskI am not very good with drupal - I did not realize you could do this!!
I will check it as soon as I find a chance, but it should work ...
Comment #13
MarcElbichon commentedAdded to new release
Comment #14
Anonymous (not verified) commentedIs this now a part of v2?
I tried setting height=100% but am still getting a small iframe window. What do I need to do to get an external URL in my iframe full height?
Comment #15
MarcElbichon commentedDue to browser security, extenal url can't be full height
Comment #16
Anonymous (not verified) commentedOh, I thought your post above meant you'd committed something to make this work...
Comment #17
MarcElbichon commentedNo
GiorgosK wanted a page without scrolling (browser). See #8 attached file. So iframe isn't full height but with a specified size and would be resized when the browser is too.
Comment #18
Anonymous (not verified) commentedOk, thanks.