如何动态改变内容高度 [英] how to vary the content height dynamically

查看:88
本文介绍了如何动态改变内容高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用

加载标签内容

I am loading the tab content using

tabbar.setContentHref("a1","Home/About");



我有anothar替换是使用加载内容。,


I have anothar alternation is to load the content using .,

tabbar.setContentHtml("<iframe src='/Home/About'>")



我想要的是在加载时动态改变内容高度。我用谷歌搜索,但没有解决方案适合我。有没有其他方法来加载内容??任何人都可以帮我解决这个问题。


What I want is that vary the content height dynamically while loading. I have googled ,but no solutions are working for me. Is there any other ways to load the content ??. can any one help me how to fix this.

推荐答案

你的tabbar组件究竟是什么?如果它是dhtmlxtabbar,这个可以帮助你: http://www.dhtmlx.com /docs/products/dhtmlxTabbar/samples/06_behaviors/02_size_by_content.html [ ^ ]。

但请注意,iframe是最糟糕的做法。第一种方法有什么问题?那个是使用ajax,因此根据需要更新dom,并且自动调整大小(参见上面的链接)将起作用。

尽管如此,如果你不尝试突破安全边界,你有办法从内部调整iframe的大小。请看这里: http://www.pither.com/articles/2010 / 11/12 / resize-iframe-from-within [ ^ ]
What exactly is your tabbar component? If it is dhtmlxtabbar, this one could help you: http://www.dhtmlx.com/docs/products/dhtmlxTabbar/samples/06_behaviors/02_size_by_content.html[^].
But please note, that the iframe is the worst practice here. What is wrong with the first approach? That one is using ajax, thus updates the dom as needed, and autosize (see link above) will work.
Still, if you don''t try break to security boundaries, you have means to resize iframe from inside. Take a look here: http://www.pither.com/articles/2010/11/12/resize-iframe-from-within[^]


这篇关于如何动态改变内容高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆