WordPress - 奇怪的加载问题

发布于 2024-11-02 21:29:02 字数 393 浏览 0 评论 0原文

我目前正在使用此主题的修改版本来显示年度报告:

http://www.elegantthemes。 com/preview/ElegantEstate/

我无法链接该报告,因为我们的项目经理希望在发布之前保持该网站的私密性。

项目经理抱怨一种奇怪的加载模式,即功能滑块中的某些内容会在第一张幻灯片之前显示几秒钟,直到页面完全加载。我自己没有这个问题。

谁能解释为什么会发生这种情况,以及我该如何解决它?我可以安装一个可以预加载整个页面或类似内容的插件吗?

我尝试了图像预加载插件,但没有解决问题。

感谢您的帮助。

I am currently using a modified version of this theme to display an annual report:

http://www.elegantthemes.com/preview/ElegantEstate/

I can't link the report as our project manager wants to keep the site private until launch.

The project manager is complaining of a strange loading pattern where some content in the features slider shows up before the first slide for a few seconds, until the page is completely loaded. I do not have this problem myself.

Could anyone explain why this might be happening, and how I could fix it? Could I install a plugin that would pre-load the entire page or something like that?

I tried an image pre-loader plugin that did not solve the problem.

Thanks for your help.

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

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

发布评论

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

评论(1

池木 2024-11-09 21:29:02

许多滑块采用一种技术,将所有内容加载到 html 中,例如:

<div id="slider">
  <div class="pane">
    content
  </div>
  <div class="pane">
    content
  </div>
  <div class="pane">
    content
  </div>
</div>

虽然所有三个单独窗格的高度和宽度组合的高度和宽度,它将大于滑块包装 div。对于那些不使用 JS 的人来说,这就是他们会看到的。这被认为是优雅的降级,即他们不会获得精美的滑块,但他们仍然能够看到内容。

一旦 JS 在页面中加载,滑块脚本很可能会应用 CSS 规则来限制可查看滑块区域的大小。滑块可能会获得高度和宽度参数以及溢出声明,例如:

width:200px;
height:200px;
overflow:hidden;

一旦这些规则生效,滑块将看起来像它应该的那样。在此之前,您的滑块看起来将不再像滑块,并且所有内容都将以非常丑陋的方式可见。

您的项目经理的看法与您不同的原因可能是由于连接速度不同或各个浏览器不一致。在我看来,你的滑块正在工作,你只是想让它做一些它不应该做的事情。

我认为您可以通过在 CSS 样式表中的包含 div 中添加类似于我上面显示的规则来按照您想要的方式进行破解。

我知道您无法在此处发布 url,但如果您可以发布或链接到滑块的一些 JS、HTML 和/或 CSS(甚至是本项目中使用的滑块脚本),我们可能会提供更多帮助。

Many sliders employ a technique where all of the content is loaded in the html, something like:

<div id="slider">
  <div class="pane">
    content
  </div>
  <div class="pane">
    content
  </div>
  <div class="pane">
    content
  </div>
</div>

While the height and width of the combination of all three individual pane heights and widths, it will be larger than your slider wrapper div. For those who do not use JS, this is what they will see. This is considered to be graceful degradation, whereby they will not get the fancy slider, but they still will be able to see the content.

Once the JS loads in the page, the slider script most likely applies CSS rules that limit the size of the viewable slider area. The slider will likely get height and width parameters and an overflow declaration, something like:

width:200px;
height:200px;
overflow:hidden;

Once those rules take effect, the slider will look as it should. Until that happens, your slider will look nothing like a slider and all of the content will be viewable in a very ugly fashion.

The reason why your project manager is seeing it differently than you may be due to different connection speeds or individual browser inconsistencies. It sounds to me like your slider is working, you just want it to do something that it's not meant to do.

I think you might be able to hack this to work the way you want by adding rules similar to the ones I showed above to the containing div in your CSS style sheet.

I know you cannot post the url here, but if you can post or link to some JS, HTML, and/or CSS for the slider (or even the slider script used in this project), we might be of more help.

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