1234567891011 |
- function changeScollDistance(event, ownerComponent) {
- var scrollLeft = event.detail.scrollLeft;
- var scrollWidth = event.detail.scrollWidth;
- var viewWidth = ownerComponent.selectComponent('.ant-page-infinite-content').getBoundingClientRect().width;
- var moveDom = ownerComponent.selectComponent('.ant-page-infinite-move');
- var pageDeg = Math.ceil(scrollLeft / (scrollWidth - viewWidth) * 100);
- moveDom.setStyle("transform: translateX(".concat(pageDeg, "%);"));
- }
- export default {
- changeScollDistance: changeScollDistance
- };
|