Open inJonathan opened 7 years ago
if you are using iscroll 5, the param is (el, time, offsetX, offsetY, easing) you apparently set offsetX to null and offsetY to true thus, your final offset will be offsetX=0 offsetY=center. which means your target will be at center on y axis and at left side on x axis. according to https://github.com/cubiq/iscroll/blob/master/src/core.js#L508
@TotooriaHyperion 谢谢,我试试
I want to center element to screen. I do this
myScroll.scrollToElement(document.querySelector('#scroller li:nth-child(25)'), null, null, true)
it's working in vertical scroll but not working in horizontal scroll.