Dynamic Iframe Resizing on Multiple Layers
-
Hi guys Its my first in this community and I hope someone can help me on this one. I’m currently working on the personalization of the layout of SAP ERP Portal. This Portal Framework uses Iframes to display the current page and/or applications on the Current Page. Here is a custom draw of a page ---- Custom Componentes Like Menus etc ----- Iframe (InnerPage) – Shows the Current Page --------This Page can have embedded content and/or More Iframes with Applications All the Iframes are on the same domain but I only have acess to the innerPage Code and not to the iframes that have the applications. Now we want the innerpage to automatic resize to the current content. This is being a problem (even after using jQuery Plugins or Resize Scripts) because: 1) The Iframes that have the applications change content height using Ajax/DHTML (not triggering load event) and this resize scripts wont call the resize mechanism. 2) I don’t have access to the applications source 3) On some tests ive made using Scripts ( for example Auto Height Jquery, SSI Dynamic Drive …) some iframes display the same clientHeight and ScrollHeight Even if theres a scrollbar in the browser window. If there’s anyone there that can help me solve this kind of situations it would be really helpful Thanks
modified on Thursday, September 15, 2011 4:55 PM
-
Hi guys Its my first in this community and I hope someone can help me on this one. I’m currently working on the personalization of the layout of SAP ERP Portal. This Portal Framework uses Iframes to display the current page and/or applications on the Current Page. Here is a custom draw of a page ---- Custom Componentes Like Menus etc ----- Iframe (InnerPage) – Shows the Current Page --------This Page can have embedded content and/or More Iframes with Applications All the Iframes are on the same domain but I only have acess to the innerPage Code and not to the iframes that have the applications. Now we want the innerpage to automatic resize to the current content. This is being a problem (even after using jQuery Plugins or Resize Scripts) because: 1) The Iframes that have the applications change content height using Ajax/DHTML (not triggering load event) and this resize scripts wont call the resize mechanism. 2) I don’t have access to the applications source 3) On some tests ive made using Scripts ( for example Auto Height Jquery, SSI Dynamic Drive …) some iframes display the same clientHeight and ScrollHeight Even if theres a scrollbar in the browser window. If there’s anyone there that can help me solve this kind of situations it would be really helpful Thanks
modified on Thursday, September 15, 2011 4:55 PM
Hi, iframe object see http://msdn.microsoft.com/en-us/library/ms535258.aspx The iframe element functions as a document within a document, or like a floating frame. The frames collection provides access to the contents of an iframe. Use the frames collection to read or write to elements contained in an iframe. Example sColor = document.frames("sFrameName").document.body.style.backgroundColor; frames collection see http://msdn.microsoft.com/en-us/library/ms537459.aspx iframe supports ID and NAME attributes too.
-
Hi guys Its my first in this community and I hope someone can help me on this one. I’m currently working on the personalization of the layout of SAP ERP Portal. This Portal Framework uses Iframes to display the current page and/or applications on the Current Page. Here is a custom draw of a page ---- Custom Componentes Like Menus etc ----- Iframe (InnerPage) – Shows the Current Page --------This Page can have embedded content and/or More Iframes with Applications All the Iframes are on the same domain but I only have acess to the innerPage Code and not to the iframes that have the applications. Now we want the innerpage to automatic resize to the current content. This is being a problem (even after using jQuery Plugins or Resize Scripts) because: 1) The Iframes that have the applications change content height using Ajax/DHTML (not triggering load event) and this resize scripts wont call the resize mechanism. 2) I don’t have access to the applications source 3) On some tests ive made using Scripts ( for example Auto Height Jquery, SSI Dynamic Drive …) some iframes display the same clientHeight and ScrollHeight Even if theres a scrollbar in the browser window. If there’s anyone there that can help me solve this kind of situations it would be really helpful Thanks
modified on Thursday, September 15, 2011 4:55 PM
We got the same problem, and our solution is: 1. Set the outer iframe's height to "0" 2. Create a timer to watch every 5 seconds, if the inner iframe's height is larger than an expected value, then set the outer iframe's height to INNER_HEIGHT+15px 3. Kill the timer. It works, but results in some memory leaks in Internet Explorer.
Ghoul To World! - http://www.g2w.me