交叉
<template>
<div class="about">
<div class="line"></div>
<div class="line active"></div>
<div class="small-ball" @touchstart="FnStart"></div>
<div class="small-ball ac" @touchstart="FnStart"></div>
</div>
</template>
<script>
export default {
data() {
return {};
},
methods: {
FnStart(ev) {
this.startX = ev.changedTouches[0].pageX - ev.target.offsetLeft;
this.parent=ev.target.parentNode;
this.child=this.parent.children;
this.oW=this.parent.offsetWidth-ev.target.offsetWidth;
document.ontouchmove = this.FnMove;
document.ontouchend = this.FnEnd;
},
FnMove(ev) {
this.L = ev.changedTouches[0].pageX - this.startX;
if(this.L<0)this.L=0;
if(this.L>this.oW)this.L=this.o