开发者

Javascript ContentFlow library, Remove All Items and Add New

开发者 https://www.devze.com 2023-02-15 07:53 出处:网络
Hey guys I am using the javascript ContentFlow library found HERE. I am loading items with jquery/ajax based on search criteria.

Hey guys I am using the javascript ContentFlow library found HERE.

I am loading items with jquery/ajax based on search criteria.

What I need to do is remove all of the old items before loading new items.

This works fine with a small amount of photos( less than 4) but anything more causes long running script errors.

To remove a开发者_运维技巧ll of the items I am looping and calling the rmItem() function

function clearResults() {
    var itemCount = resultFlow.getNumberOfItems();
    for (var i = 0; i < itemCount; i++) {
        resultFlow.rmItem(0);
    }
}

Any ideas how to accomplish this?


I ended up just adding a clearItems function to the library. There was no built in functionality to reliably support this.

0

精彩评论

暂无评论...
验证码 换一张
取 消