In the sample below, I am developing app for TV, where window size is fixed. What I want is to use left right buttons to scroll the div cells. Since I will have thousands of items, I wanted to reuse fixed amount of cells. So as I moving forward through data array, I am moving the window and deleting/adding cells. In the sample below I only started to implement right scroll. The cell movement should be animated. As you can see, everything is fine, until I am deleting/adding cells (cell d1 to e1). Then it's automatically scrolling and I can't animate the scroll.
var cellToDelete = data[windowStart];
var cellToAdd = data[windowStart + WINDOW_SIZE];
windowStart++;
currentCellIndex++;
$('<div></div>').html(cellToAdd.text).addClass('cell').attr('id', cellToAdd.id).insertBefore("#dummy0");
$("#" + cellToDelete.id).remove();
How can I prevent auto scroll and animate scroll in that case?