与分辨率无关的网站? (或者,“缩放整个网站以填充浏览器”)
我正在开发一个真正受益于填充整个屏幕的项目——它本质上是一个 7000 像素长的页面,带有一个巨大的背景填充整个长度(可能被切成单独的部分,并在最终版本中以智能顺序方式加载) ),当您向下滚动时,有 5 或 6 个不同的片段/区域/幻灯片(基本上是“内容区域”)。
顶部是一个导航栏,填充了设计的整个水平宽度。在其下方的背景上,是一堆不同的元素,放置在背景上的特定位置。背景上的位置至关重要,因为每个元素都特定于页面的特定部分。
在我看来,它正在做类似 http://windyroad.org/2007 /05/18/resolution-independent-web-design/ 真的非常有用。唉,那是 2007 年的事了,看起来更像是一个概念验证。另外,每次有人调整浏览器窗口大小时,用 PHP 调整 1000x7000 像素图像的大小似乎是个坏主意(或者更糟糕的是,五个 1000x1000 图像!)。
我使用过 jQuery 脚本来缩放背景图像以填充整个浏览器,但从未遇到过任何缩放页面上每个元素的东西。
有没有办法动态缩放整个网站以适应浏览器窗口?
我很确定我已经知道答案,但我想我会把它扔在那里以防万一有人有想法。
非常感谢!
I'm working on a project that would really benefit from filling the whole screen -- it's essentially one 7000px-long page with a giant background filling the whole length (probably chopped into separate pieces and loaded in an intelligent sequential fashion in the final version), with 5 or 6 different segments/areas/slides (basically, "content areas") as you scroll down.
At the top is a navigation bar that fills the entire horizontal width of the design. Below it, on the background, are a bunch of different elements, placed at specific positions on the background. The placement on the background is critical as each element is specific to a certain section of the page.
It seems to me doing something like http://windyroad.org/2007/05/18/resolution-independent-web-design/ would be really really useful. Alas, that's from 2007 and seems more like a proof-of-concept than anything. Plus it seems like a bad idea to resize a 1000x7000px image with PHP every time somebody resizes their browser window (Or even worse, five 1000x1000 images!).
I've used jQuery scripts that scale a background image to fill the entire browser, but never ran across anything that scales every element on page.
Is there any way to dynamically scale an entire website to fit the browser window?
I'm pretty sure I already know the answer, but figured I'd toss it out there just in case somebody has an idea.
Many thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该脚本还计算滚动条大小,如果需要。您将需要一个带有 wrapper id 的块(
div
、span
等)。这是一个跨浏览器脚本,它支持所有现代浏览器。
我希望你喜欢它。放心使用!
The script also calculate the scrollbar size if needed. You will need a block (
div
,span
, etc...) with the wrapper id.This is a cross-browser script, it supports all the modern browsers.
I hope you like it. Feel free to use!