将 Javascript 与 Drupal 结合使用
我有一个网站, http://raptorshop.com
目前,我已将 CSS 设置为最小高度 700px ,但是我希望每个页面都能自动记录浏览器的大小,并相应地调整大小(以便页脚大约有 50-200px,具体取决于浏览器大小,仅此而已)。目前,如果您在小显示器上浏览该网站,它会出现滚动,这是我不想要的。
Drupal 有办法做到这一点吗?我知道如何对各个页面执行此操作,但我希望每个页面都执行这种自动检查/调整大小。
I have a website, http://raptorshop.com
Currently, I have set the CSS to have a min-height of 700px, however I would like for every page to automatically note the size of the browser, and resize accordingly (so that the footer has about 50-200px depending on browser size, but nothing more). Currently, if you browse to the site on a small monitor, it gives a scroll, which I do not want.
Is there a way to do this in Drupal? I know how to do it for individual pages, but I want every page to do this sort of automatic check/resize.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 jquery 轻松检查窗口高度,然后根据需要更改 css。
一个例子:
You can check the window height with jquery pretty easily, then change the css as needed.
An example:
您将必须编辑一些模板文件,例如网站页眉和页脚的模板文件。在这些中,听起来您真正想要实现的是 CSS 粘性页脚。
您可以在这里获取其中之一:http://www.cssstickyfooter.com/
You're going to have to edit some template files, such as those for the site's header and footer. In those, it sounds like what you really want to implement is a CSS Sticky Footer.
You can get one of those here: http://www.cssstickyfooter.com/