在jQuery动画中展开Iframe展开内容
我正在使用用户信息中心项目,用户可以与窗口小部件进行交互(非常类似于iGoogle信息中心)。我使用jQueryUI portlet来保存iframe。我遇到的问题是,我想调整iframe的实时iframe内的内容扩展使用jQuery动画。例如,我在iframe中有一个自定义的手风琴控件。当用户单击面板以展开折叠时,我调用slideDown()函数显示内容。当slideDown()动画完成时,我基于body的新高度调整iframe的大小。结果是手风琴的内容向下滑动,直到它们在幻灯片动画期间离开小部件的边界。一旦动画完成,调整大小照顾新的小部件高度,一切看起来不错。这是相当浪费的动画,我想调整iframe的大小,所以它在slideDown()动画期间扩展到iframe的身高。在幻灯片动画期间,我可以根据身高来扩展iframe?
I'm working on a user dashboard project where a user can interact with widgets (very similar to iGoogle dashboard). I'm using jQueryUI portlets to hold iframes. The problem I'm running into is that I would like to resize the iframe in real-time when the contents inside the iframe expand using jQuery animation. For example, I have a custom accordion control inside an iframe. When the user clicks on a panel to expand the accordion, I call the slideDown() function to show the content. When the slideDown() animation is complete, I resize the iframe based on the body's new height. The result is the contents of the accordion slide down until they go out of bounds of the widget during the slide animation. Once the animation is complete, the resize takes care of the new widget height and everything looks good. This is pretty choppy animation and I would like to resize the iframe so it expands to the iframe's body height during the slideDown() animation. What can I do to expand the iframe based on the body height during the slide animation?
这是我目前使用的代码。
Here is the code I'm currently using.
// This code gets fired on an accordion panel click event.
content.slideDown(100, function ()
{
parent.expandContainer('panel1', $('body').height());
});
// This code resides in the parent page hosting the iframes.
function expandContainer(elementId, height)
{
$('#' + elementId).children('.content').find('iframe').css('height', height + 'px');
}
从我的研究iframe不能扩大。他们必须有一个固定的宽度&
From my research iframes cannot be expanded. They must be given a fixed width & height.