SliderCaptcha
SliderCaptcha copied to clipboard
希望增加按住拼图块也能拉动的功能
能不能加个按住图片上的拼图块也能拉动的功能?而不是只能在下方滑块处拉动
我自己改了一下bindEvents部分,i modified the bindEvents part to support block slide.
`this.slider.addEventListener('mousedown', handleDragStart); this.slider.addEventListener('touchstart', handleDragStart); // document.addEventListener('mousemove', handleDragMove); // document.addEventListener('touchmove', handleDragMove); // document.addEventListener('mouseup', handleDragEnd); // document.addEventListener('touchend', handleDragEnd); // document.addEventListener('mousedown', function () { return false; }); // document.addEventListener('touchstart', function () { return false; }); // document.addEventListener('swipe', function () { return false; }); this.slider.addEventListener('mousemove', handleDragMove); this.slider.addEventListener('touchmove', handleDragMove); this.slider.addEventListener('mouseup', handleDragEnd); this.slider.addEventListener('touchend', handleDragEnd); this.slider.addEventListener('mousedown', function () { return false; }); this.slider.addEventListener('touchstart', function () { return false; }); this.slider.addEventListener('swipe', function () { return false; });
this.block.addEventListener('mousedown', handleDragStart);
this.block.addEventListener('touchstart', handleDragStart);
this.block.addEventListener('mousemove', handleDragMove);
this.block.addEventListener('touchmove', handleDragMove);
this.block.addEventListener('mouseup', handleDragEnd);
this.block.addEventListener('touchend', handleDragEnd);
this.block.addEventListener('mousedown', function () { return false; });
this.block.addEventListener('touchstart', function () { return false; });
this.block.addEventListener('swipe', function () { return false; });`