jQuery:动态设置 div 高度并在窗口调整大小时更改
如何在窗口大小调整时调整 Div 的大小,该 div 位于其他 div 之间,我不知道如何调整;但我想要那个 div;有高度;使其位于 div 下方;显示为页脚。
好吧,我知道我说的没有意义,但这就是我的意思:http://i44。 tinypic.com/9v8t1u.jpg
换句话说,我正在尝试做http://www.tumblr.com 已对其索引进行了处理。 “你会喜欢 Tumblr 的 30 个理由”并未定位为绝对位置和底部 0,但他们将溢出设置为隐藏,并且每次调整窗口大小时都会更改中间 div 的高度。
我也在使用 jQuery。
并不是我缺乏编码技能,而是我想不出一种方法来执行 Div3 始终显示为页脚。
有谁知道该怎么做?
多谢
How can I resize a Div on window resize, which the div is in between other div's and I can't think of how; but I want that div; to have a height; so that its beneath div; is shown as footer.
Ok I know that what I said doesn't make sense but here is what I meat: http://i44.tinypic.com/9v8t1u.jpg
In other words, I am trying to do what http://www.tumblr.com has done on their index. The '30 reasons you'll love Tumblr' is not positioned as absolute and bottom 0, but they've set overflow to hidden, and they change the height of the middle div everytime a window resizes.
I am using jQuery as well.
It's not that I am lacking of coding skills but I just can't think of a way to perform the Div3 is always shown as a footer.
Does anyone know how to do this?
Thanks alot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为此,您实际上并不需要 jQuery。看看这个CSS解决方案:http://ryanfait.com/sticky-footer/
You don't really need jQuery for this. Check out this css solution: http://ryanfait.com/sticky-footer/
您可以使用 jquery 的 .resize() 事件
这是链接:
Jquery 调整大小 API
You can use .resize() event of jquery
here's the Link:
Jquery resize API