为什么我的网站滚动缓慢,并且悬停效果迟缓?我该如何解决这个问题?

发布于 2024-11-01 00:03:14 字数 393 浏览 4 评论 0原文

因此,我的网站此处存在重大性能问题。滚动非常慢,悬停效果有一点滞后和其他类似问题。不幸的是,现在我正在一个廉价的主机上工作,所以我无法选择 gzip 我的文件,但我不确定这有多大的影响因素。无论如何,我使用 Drupal 作为 CMS。

我想知道延迟的各种原因以及我可以采取哪些措施来解决它。

一些关于:主页的内存统计信息:

内存:
- 私人:49664k
- 共享:13052k
- 总计:62716k

虚拟内存:
- 私人:53400k
- 映射:10412;

如果您需要更多信息,请告诉我。

So I have this site here which has major performance issues. Scrolling is very slow, hover effects have a bit of lag and other similar issue. Unfortunately right now I am working off a cheap host so I don't have the option to gzip my files and I am not sure how big a contributing factor that is, though. For what it's worth, I am using Drupal as a CMS.

I would like to know the various reasons for the lag and what I can do to fix it.

Some about:memory stats for the homepage :

Memory:
- Private:49664k
- Shared:13052k
- Total: 62716k

Virtual Memory:
- Private : 53400k
- Mapped : 10412;

Let me know if you need any more information.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

反目相谮 2024-11-08 00:03:14

在我的机器(运行 Chrome 10 的 2009 MacBook Pro)上看起来不错,但我认为你需要区分“性能”的概念。

gzipping 可以减小构成站点的文本文件的大小,从而减少它们从 Web 服务器传输到最终用户计算机所需的时间。这发生在页面加载到用户浏览器之前。加载后,它不会影响页面的滚动速度。

页面上似乎确实包含了大量 JavaScript 文件,其中一些文件的名称中带有“scroll”。我不确定它们中的任何一个在用户滚动时是否正在运行,从而减慢浏览器的速度,但它似乎是最有可能缓慢滚动的候选者。 (哦——除非meagar关于background-size: cover;的评论是正确的。)

Edit: as background-size: cover 似乎是问题,我建议删除它,并将背景图像设置得相当大,以便在大多数屏幕分辨率下看起来可以接受。您可能希望让图像制作者对其进行编辑,使其在边缘淡出为单一颜色,以便它与高分辨率用户的背景颜色混合。

It seems fine on my machine (2009 MacBook Pro running Chrome 10), but I think you need to pick apart the idea of “performance”.

gzipping reduces the size of the text files that make up your site, so it reduces the time required for them to get from your web server to end users’ machines. That happens before the page loads in the user’s browser. It doesn’t affect the scrolling speed of the page once it’s loaded.

There does seem to be a metric crap-ton of JavaScript files included on the page, a few of which have “scroll” in their name. I’m not sure if any of them are running when the user scrolls, and thus slowing the browser down, but it seems like the most likely candidate for slow scrolling. (Ooh — unless meagar’s comment about background-size: cover; is right.)

Edit: as background-size: cover seems to be the issue, I’d suggest removing it, and making your background image reasonably big, so that it looks acceptable at most screen resolutions. You might want to get whoever made the image to edit it so that it fades out to a single color at the edges, so that it blends into your background-color for users on higher resolutions.

彩虹直至黑白 2024-11-08 00:03:14

我使用 Firebug 删除了背景图像和定位,滚动速度立即加快。

速度的部分原因在于各种 JavaScript 组件,但最明显的“滞后”是 CSS 中为 HTML 元素指定的固定 2000x2000 图像。

I removed the background image and positioning using Firebug and the scrolling instantly speeded up.

Part of the speed will be the various JavaScript components, but the most noticable 'lag' was the fixed 2000x2000 image specified in the CSS for the HTML element.

谁对谁错谁最难过 2024-11-08 00:03:14

嗯,CMS 通常会导致很大的延迟。原因:因为他们倾向于吹嘘一堆被称为 JavaScript 的错综复杂的废话,通过提供简单的用法来吸引用户使用。大多数情况下,JavaScript 本质上是没有用的。我遇到过看起来不错的网站,但即使是我最新的外星人游戏机也会出现消化不良的情况。原因是:几乎所有事情都使用了 JavaScript。无论您使用 CMS 还是复制粘贴自定义网页,这都会极大地减慢速度。

我学到的简单设计规则:在任务需要时使用 JavaSript。永远不要在它不添加任何功能的情况下这样做,或者仅在您正在学习并想要测试东西时才这样做,当然,当您的客户因为想要动画弹出窗口、视差滚动等而不断敲打您的门时才这样做。

在某些情况下,您需要 JS,即使是为了美观,但在太多页面上,它就太多了。结果:人们会喜欢你的网页,你的照片库页面不会花 15 秒就可以显示一张难看的新图片,或者滚动速度会让你认为 20 世纪 90 年代初的互联网实际上“更快”......

Well, CMS usually cause a lot of lag. Why: because they have a tendency to boast a convoluted pile of malarkey called JavaScript, which seduces the user to utilize by offering simple usage. In most cases, JavaScript is essentially useless. I have encountered websites that looked good, but that give even my newest alienware-gaming-machine indigestion. Reason is: JavaScript was used, for nearly everything. This slows things down, immensely, whether you use a CMS or copy-paste a custom webpage.

Simple design rule I've learnt: use JavaSript when necessary for a task. Never, ever in cases where it does not add any functionality, or do it only when you are learning and want to test thing and naturally when your customers keep banging at your door because they want animated pop-ups, parallax scrolling and the like.

There are instances, where you will need JS, even for eyecandy, but on too many pages, it is too much. Result: people will love your webpage, where your photo gallery page won't take 15 seconds to display a meezly new picture or the scrolling speed will make you think that the internet was actually "faster" in the early 1990s...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文