我正在使用Foundation构建的网站上工作,我尝试升级到5.2.0以查看是否解决了Orbit问题(以及其他问题)。我通过data-orbit
之类的数据属性初始化组件,当我在页脚中使用较旧的CDN版本并初始化时,一切正常:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/foundation/5.0.2/js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>
我只使用Orbit,Reveal,Topbar和Dropdown,所以我想构建和缩小我自己的5.2.0(或主程)包。应该是直截了当的:
<script src="/js/vendor/jquery.js"></script>
<script src="/js/foundation/foundation.js"></script>
<script src="/js/foundation/foundation.abide.js"></script>
<script src="/js/foundation/foundation.accordion.js"></script>
<script src="/js/foundation/foundation.alert.js"></script>
<script src="/js/foundation/foundation.clearing.js"></script>
<script src="/js/foundation/foundation.dropdown.js"></script>
<script src="/js/foundation/foundation.equalizer.js"></script>
<script src="/js/foundation/foundation.interchange.js"></script>
<script src="/js/foundation/foundation.joyride.js"></script>
<script src="/js/foundation/foundation.magellan.js"></script>
<script src="/js/foundation/foundation.offcanvas.js"></script>
<script src="/js/foundation/foundation.orbit.js"></script>
<script src="/js/foundation/foundation.reveal.js"></script>
<script src="/js/foundation/foundation.slider.js"></script>
<script src="/js/foundation/foundation.tab.js"></script>
<script src="/js/foundation/foundation.tooltip.js"></script>
<script src="/js/foundation/foundation.topbar.js"></script>
<script>
$(document).foundation();
</script>
我将所有内容都包含在Hail Mary中,想知道是否存在交叉依赖关系,但是每个(以前工作的)模块都无法加载。我检查过的事情:
$(document).foundation('orbit');
)没有区别虽然每个模块都会中断,但这是我的Orbit标记(带有EE标签)的一个示例,以防万一我做了一些愚蠢的事情:
<ul data-orbit class="orbit-container" data-options="bullets:false;timer:false;slide_number:false;">
{product_images}
<li class="slide" data-orbit-slide="slide-{file_id}">
{exp:ce_img:single src='{url}' alt='{alt_text}' width='635' height='476' crop='yes'}
{if caption}
<div class="orbit-caption">
{caption}
</div>
{/if}
</li>
{/product_images}
{if product_video}
<li class="slide" data-orbit-slide="slide-video">
<div class="flex-video">
{product_video width="100%"}
</div>
</li>
{/if}
</ul>
还有其他一些初始化技巧吗?我的理解是你需要在页眉中加载快速单击,加载jQuery,然后加载foundation.js
,然后加载页脚中的模块,最后调用$(document).foundation()
来初始化页面上使用的任何模块。但显然我错过了一些东西。
答案 0 :(得分:1)
这是SCSS。您无法编译旧的SCSS并期望它与5.0.2-5.0.3和更新版本的框架一起使用。套餐优惠,马特。