动态DIV容器w。溢出:自动调整大小 - 没有Java?! [英] Dynamic DIV container w. overflow:auto on Resize - w/o Java?!

查看:57
本文介绍了动态DIV容器w。溢出:自动调整大小 - 没有Java?!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

各位大家好!


看来我最终找到了一个有着精明人士的地方;-)以下问题让我感到困惑 - 希望有人可以帮助我!


---------------------------------------- --------

- 头 -

----------------------- -------------------------

- - -

- m - -

- e - -

- n - 内容 -

- 你 - -

- - -

---------------------------------------------- -

- 页脚 -

----------------------------- -------------------


上面的布局包含:


- a固定头(宽度和高度)

- a固定菜单(宽度和宽度)高度)

- 内容区域(固定宽度,溢出:自动)

- 固定页脚(宽度和高度)


溢出:内容区域中的auto用于实现一个位置:固定效果,适用于几乎所有浏览器,不使用任何hacks或java。如果内容变得更长,则会生成一个滚动条。


我希望这个DIV容器能够保持其固定宽度,但要改变它的高度以适应当前vierwport。


示例:


- 视口大小增加,内容容器也增加。一旦窗口足够大,scollbar就会消失。


- 视口大小减小,内容容器也减少。一旦窗口变得太小,就会出现scollbar。


可以这样做 - 这可以在不使用Java的情况下实现吗?


祝你好运,


MrPutty

Hello everyone!

It seems I''ve finaly found a place with savy folks ;-) The following problem has me puzzeled - hopefully someone can help me out!

------------------------------------------------
- head -
------------------------------------------------
- - -
- m - -
- e - -
- n - content -
- u - -
- - -
------------------------------------------------
- footer -
------------------------------------------------

The layout above contains:

- a fixed head (width & height)
- a fixed menu (width & height)
- a content area (fixed width, overflow:auto)
- a fixed footer (width & height)

The overflow:auto in the content area is used to achieve a position:fixed effect, for almost all browsers, without using any hacks or java. A scrollbar is generated if the content becomes longer.

I''d like this DIV container to keep it''s fixed width, but change it''s height to fit the current vierwport.

Examples:

- Viewport size increases, so does the content container. The scollbar should dissapear once the window is large enough.

- Viewport size decreases, so does the content container. The scollbar should appear once the window becomes too small.

Can this be done - and can this be achieved without the use of Java?

Best regards,

MrPutty

推荐答案

我假设你的意思是javascript而不是java。请记住,java不是javascript。


你想用html / css做什么。我有这样一个网站,但我永远不会记得当有人问我做了什么。我必须仔细查看并稍后再回复你。我假设您希望页脚粘到底部?
I assume you mean javascript and not java. Remember that java is not javascript.

What you want can be done with html/css. I have such a site but I can never remember what I did when someone asks. I''ll have to look it up and get back to you later. I assume you want the footer to stick to the bottom?


感谢您的回复。是的,页脚应该粘在视口的底部。如果可能,即使在调整窗口大小后也是如此。我很想看到你用过的编码。
Thank you for your reply. Yes, the footer should stick to the bottom of the viewport. If possible, even after resizing the window. I''d love to see the coding you''ve used.


我会告诉你的。忙着,今天忙我。
I will get this to you. Just busy, busy for me today.


这篇关于动态DIV容器w。溢出:自动调整大小 - 没有Java?!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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