First improvement. Replace the line
with these three linesCode:slideElem.style.marginLeft=(-(curSlide*slideWidth+curSlidePos))+"px";
for a kind of ease-in/out movement.Code:var curWidth=slideWidth*((curSlidePos>0)?slideCount-slidesVisible:1); var offset=Math.sign(curSlidePos)*(1-Math.cos(curSlidePos/curWidth*Math.PI))/2*curWidth; slideElem.style.marginLeft=(-(curSlide*slideWidth+offset))+"px";
Compare here
Bookmarks