[英]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.