有没有办法用infinitescroll在magento中实现masonry.js?

时间:2014-12-11 08:48:58

标签: php magento-1.8 infinite-scroll masonry

对于infinitescroll am使用免费扩展名:' vs-infinite-ajax-scrolling',这个扩展提供noconfilct解决方案,它导入的jquery版本是1.7.2,我正在寻找一种实现砌体的方法。来自desendro的js具有此扩展名并在默认magento中集成。任何人都可以指导我。

1 个答案:

答案 0 :(得分:2)

有关说明,请参阅http://masonry.desandro.com/#getting-started

Magento的项目列表可能看起来像这样:

<ul class="products-grid">
    <li class="item">...product info here...</li>
    <li class="item">...product info here...</li>
    <li class="item">...product info here...</li>
</ul>

因此。按照Masonry主页上的说明,您需要首先确保包含在您页面部分中的Masony JS,将其添加到您的某些XML中 - 例如您的主题的local.xml文件默认部分或者可能只是在目录列表部分中,因此它不会被包含在不需要它的页面上。

如果您无法弄清楚如何执行此操作,请询问有关如何将自定义JS添加到产品详情页面的新问题。这就是我具体的意思。您需要完成初始工作,将问题分解为较小的部分,并根据手头的具体任务提出问题。互联网上没有人喜欢做我正在做的事情并且在整个过程中牵着你的手。在业余时间。免费。

接下来是使用其主页上提供的两种方法之一初始化产品列表中的Masonry脚本。例如,您可以将其添加到-tag:

<ul class="products-grid js-masonry" data-masonry-options="{ 'columnWidth': 200, 'itemSelector': '.item' }">
    <li class="item">...product info goes here..</li>
    <li class="item">...product info goes here..</li>
    <li class="item">...product info goes here..</li>
</ul>

它应该可能有用,可能还有一些CSS修复。