JavaScript 调整大小
我对 javascript 的了解很少,所以这似乎是一个非常基本的问题,但找不到方法来做到这一点。
我有一个 1024*768 的固定区域,如下所示:
alt text http://img260.imageshack .us/img260/4618/myimage.png
在“A部分”的右侧会有一个javascript按钮。当我单击该按钮时,A 部分将自动调整大小,如下所示:
alt text http://img705.imageshack.us/img705/92/myimage1.png
因此,A 部分将与 B 部分重叠,并且它将与 C 部分大小相同(并且我知道部分的大小C)。如何使用重叠功能自动调整该区域的大小?我正在寻找 Jquery 的插件,但找不到。 Jquery中有一个可调整大小的函数,但它对我没有帮助。你能帮我一下吗? (如果你只给我一个与此功能相关的链接,那就足够了)
编辑:额外说明,A 部分是一个 flash 对象,因此当我单击该按钮时,它会放大并与 B 部分重叠。
谢谢,
I have very little javascript knowledge, so it seems a very basic question, but could not find a way to do that.
I have a 1024*768 fixed area like this:
alt text http://img260.imageshack.us/img260/4618/myimage.png
There will be a javascript button on the right side of the "Section A". When I click that button, Section A will be automatically resized and it will be something like this:
alt text http://img705.imageshack.us/img705/92/myimage1.png
So, Section A will overlap with Section B, and it will be same size with Section C (And i know the size of Section C). How can I automatically resize that area with overlap function? I am looking a plugin for Jquery, but could not find that. There is a resizable function in Jquery, but it does not help me. Could you help me out? (If you just give me a link that is related with this feature, that would be enough too)
edit: For extra note, Section A is a flash object, so it will enlarge and overlap with Section B when I click to that button.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
jQuery
hide()
效果在这里很有用。如果 A 部分和B 部分有一个float: left
,当 B 部分隐藏时,A 部分应该展开以填充该区域。http://docs.jquery.com/Effects/hide
The jQuery
hide()
effect would be useful here. If both Section A & Section B have afloat: left
Section A should expand to fill the area when Section B is hidden.http://docs.jquery.com/Effects/hide
您尝试过动画功能吗?
http://docs.jquery.com/Effects/animate
可以使用 A 隐藏 B 部分滑动或让 A 部分重叠,就像您提到的那样,只需要正确设置定位、z 索引等。
Have you tried the animate function?
http://docs.jquery.com/Effects/animate
Could have Section B hide with a slide or have Section A overlap it like you mentioned just need to set the positioning, z-index, etc. properly.
像这样的东西:
something like this: