Php 战略-无限滚动不起作用
我想在我的magento网站中实现无限滚动,所以我安装了Strategery-InfiniteScroll扩展,但它不起作用,首先我认为这是因为我仍然有分页功能,但即使移除分页工具栏,它也不起作用。 我删除了那些工具栏divPhp 战略-无限滚动不起作用,php,magento,infinite-scroll,magento-1.9,Php,Magento,Infinite Scroll,Magento 1.9,我想在我的magento网站中实现无限滚动,所以我安装了Strategery-InfiniteScroll扩展,但它不起作用,首先我认为这是因为我仍然有分页功能,但即使移除分页工具栏,它也不起作用。 我删除了那些工具栏div <div class="toolbar-top"> <?php echo $this->getToolbarHtml() ?> </div> 自上而下。 您能帮我配置Strategery-InfiniteScroll扩
<div class="toolbar-top">
<?php echo $this->getToolbarHtml() ?>
</div>
自上而下。
您能帮我配置Strategery-InfiniteScroll扩展吗?来自:
如果复制webroot上的“infinitescroll”文件夹,则文件
将以默认主题结束。这在大多数情况下应该是可以的
因为Magento在安装时会退回到默认主题
可以在自定义主题中找到文件。本文的其余部分将介绍
插件未从默认值正确加载的场景
包装/主题
您应该做的第一件事是将它们移动到您正在使用的包/主题
使用,只是为了确保它们将被加载
- 始终在Include jQuery字段上设置“是”
- 始终查看产品列表div类与内容字段中的相同。默认主题为“.category products”类(带点为 第一个登录类名称)
- 始终在“隐藏工具栏”字段上设置“否”
导致某些扩展以JSON而不是HTML修改系统输出的原因-我通过以下方式解决了这个问题: 在JQuery-ias.js中,第340行
return $.get(loadEvent.url, null, $.proxy(function(data) {
$itemContainer = $(this.itemsContainerSelector, data).eq(0);
if (0 === $itemContainer.length) {
$itemContainer = $(data).filter(this.itemsContainerSelector).eq(0);
}
if ($itemContainer) {
$itemContainer.find(this.itemSelector).each(function() {
items.push(this);
});
}
self.fire('loaded', [data, items]);
if (callback) {
timeDiff = +new Date() - timeStart;
if (timeDiff < delay) {
setTimeout(function() {
callback.call(self, data, items);
}, delay - timeDiff);
} else {
callback.call(self, data, items);
}
}
}, self), 'html');
返回$.get(loadEvent.url,null,$.proxy(函数(数据)){
$itemContainer=$(this.itemsContainerSelector,data).eq(0);
if(0==$itemContainer.length){
$itemContainer=$(数据).filter(this.itemsContainerSelector).eq(0);
}
如果($itemContainer){
$itemContainer.find(this.itemSelector).each(函数(){
项目。推(这个);
});
}
自燃('加载',[数据,项目]);
如果(回调){
timeDiff=+new Date()-timeStart;
if(时间差<延迟){
setTimeout(函数(){
callback.call(self、data、items);
}延迟-时间差);
}否则{
callback.call(self、data、items);
}
}
},self)、“html”);
我把它改成这样:
return $.get(loadEvent.url, null, $.proxy(function(data) {
data = data['maincontent']; // HERE TO CATCH THE RIGHT HTML CONTENT
$itemContainer = $(this.itemsContainerSelector, data).eq(0);
if (0 === $itemContainer.length) {
$itemContainer = $(data).filter(this.itemsContainerSelector).eq(0);
}
if ($itemContainer) {
$itemContainer.find(this.itemSelector).each(function() {
items.push(this);
});
}
self.fire('loaded', [data, items]);
if (callback) {
timeDiff = +new Date() - timeStart;
if (timeDiff < delay) {
setTimeout(function() {
callback.call(self, data, items);
}, delay - timeDiff);
} else {
callback.call(self, data, items);
}
}
}, self), 'json'); // I've changed html by JSon
返回$.get(loadEvent.url,null,$.proxy(函数(数据)){
data=data['maincontent'];//在这里捕获正确的HTML内容
$itemContainer=$(this.itemsContainerSelector,data).eq(0);
if(0==$itemContainer.length){
$itemContainer=$(数据).filter(this.itemsContainerSelector).eq(0);
}
如果($itemContainer){
$itemContainer.find(this.itemSelector).each(函数(){
项目。推(这个);
});
}
自燃('加载',[数据,项目]);