Closed j69 closed 1 year ago
It doesn't look like you're updating the MovingBoxes plugin. Also, if you're adding panels in front, you'll need to change the current panel number. Try this (untested):
completed : function(e, slider, tar){
// back button click
if ( tar === 1 ){
listOfMyPanels.prepend(newPanels);
slider.curPanel += newPanels.length; // assuming newPanels is a jQuery object
slider.update(); // tell MovingBoxes that there are new panels.
}
}
This may not look very pretty because you'll be adding new panels to the left after the slider has finished moving. And it will add panels no matter which direction you go to get to it (if wrap
is true
). I would be better to use the initChange
callback, but currently there isn't any way to change the target panel... I'll work on fixing that.
Update: actually, now that I've thought about it, calling an update in the initChange
function would cause an infinite loop, so bad idea! I think we're stuck with the code above for now =(.
Hello! i try to add some more panels before the first slide
but movingboxes need to recalculate:
base.totalPanels
andcurPanel=curPanel+quanity of new items
.new pannels add, but then its scrolling right to current panel how can i remove these scroll?