function swiper1TouchHandler() {
var s = $("#swiper1 > .swiper-wrapper:eq(0)");
var x = $(s).offset().left;
dmx.parse("swiper1Xpos.setValue('" + x + "')")
}
Message from chrome:
[Violation] Added non-passive event listener to a scroll-blocking ‘touchmove’ event. Consider marking event handler as ‘passive’ to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
Also you don’t need the JavaScript function at all you can just call the setValue action directly and use the swipes data all in one dynamic event action
ontouchmove=" var s = $("#swiper1 > .swiper-wrapper:eq(0)"); var x = $(s).offset().left; dmx.parse("swiper1x.setValue('" + x + "')")">
For anyone else, to get the x value of a swiper offset is not right.
This is correct:
var s = $("#swiper1 > .swiper-wrapper:eq(0)");
var style = window.getComputedStyle($(s).get(0));
var matrix = new WebKitCSSMatrix(style.webkitTransform);
var x = matrix.m41
dmx.parse("swiper1x.setValue(" + x + ")")