简体   繁体   English

WP + W3c Total Cache打破了Minify的响应式菜单

[英]WP + W3c Total Cache brokes responsive menu on Minify

i have a responsive website and i have activaded w3c total cache. 我有一个反应灵敏的网站,并且我已经激活了w3c的总缓存。 whenever i Minify, the responsive menu is misssing. 每当我缩小时,响应式菜单就会丢失。 This menu is activated on specific screen sizes, the code is: 此菜单在特定的屏幕尺寸上被激活,代码为:

<div class="main-nav">
  <div id="responsive_current_menu_item">Welcome to Yum Yum Videos!</div>
    <ul id="menu-top-menu" class="menu">
      <li>...</li>
    </ul>
    <a id="responsive_menu_button"></a>
</div>

The problem is, that whenever i minify, the id="responsive_current_menu_item" and id="responsive_menu_button" simply dissapear from code. 问题是,每当我缩小时, id="responsive_current_menu_item" response_current_menu_item id="responsive_current_menu_item"id="responsive_menu_button" response_menu_button”就会从代码中消失。

you can see it in action here (is the top menu, w3c tocal cache is deactivated in order to show responsive menu) 您可以在此处看到它的运行情况(是顶部菜单,为了显示响应菜单,已禁用w3c tocal缓存)

any idea where i might take a look please? 任何想法,我可以看看吗? thanks a lot in advance 提前非常感谢

我已经解决了这样一个问题,即更改了性能部分中的缩小设置,当然我之前已经用空的缓存按钮还原了所有内容。我认为该错误是由压缩代码创建的...

We would need a little more input about how your menu works. 我们需要更多有关菜单工作方式的信息。

Just a guess: You responsive menu depends on jQuery, but jQuery is being loaded after the JS-Code for your menu has been loaded. 只是一个猜测:您的响应菜单取决于jQuery,但是在加载菜单的JS代码之后才加载jQuery。 It can't work that way. 它不可能那样工作。 Try to change the minifying order and set the jQuery script to be loaded as first JS in all templates, embedded in the header. 尝试更改最小化顺序,并将jQuery脚本设置为在所有模板中嵌入到标头中的第一个JS加载。

Same applies to CSS-minifying. 同样适用于CSS缩小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM