[英]Is it possible to load more pages with javascript inside using infinity-scroll?
我的问题是以下内容,我有一个动态页面,可从数据库中获取产品的图像。 我在此处显示14个带有子产品图像的产品:“ http://www.14u-fashion.com/shop/cat/65 ”。 我想删除箭头并使它成为无限滚动,我使用了这个库:“ github.com/paulirish/infinite-scroll”,一切正常(在这里工作“ dokimastiko.14u-fashion.com/shop/cat/65 ”),但是当我在滚动条上加载更多内容时,使图像旋转的javascript(每个产品上的箭头“可点击”)不会继续显示。 到目前为止我的代码是
$o . ="$('#catview').infinitescroll({
navSelector:'div.nextPage',
nextSelector:'div.nextPage a:first',
itemSelector:'#catview div.loadPage',
loading:
{
finishedMsg: '',
msgText: '',
img : '/../../../images/loading.gif',
},
debug:true;
animate: true,
});
";
任何使其与javascript一起工作的方法? 我尝试使用pathParse,但发生了更多错误
使您的js代码使图像变成函数,并使用可选的回调$(elem).infinitescroll(options,[callback])
再次调用该函数
像这样:
function codeForImageTurn(){
//turn image, click stuff
}
//run once when page load
codeForImageTurn();
//add as callback everytime scroll elements are added so it will re-run
$o. = "$('#catview').infinitescroll({
navSelector:'div.nextPage',
nextSelector:'div.nextPage a:first',
itemSelector:'#catview div.loadPage',
loading:
{
finishedMsg: '',
msgText: '',
img : '/../../../images/loading.gif', //starting with `/` means root, you can't go anything up
},
debug:true;
animate: true,
},function(){
codeForImageTurn();
});
";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.