Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望增加按住拼图块也能拉动的功能 #14

Open
jinxishe opened this issue May 19, 2022 · 1 comment
Open

希望增加按住拼图块也能拉动的功能 #14

jinxishe opened this issue May 19, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@jinxishe
Copy link

能不能加个按住图片上的拼图块也能拉动的功能?而不是只能在下方滑块处拉动

@jinxishe
Copy link
Author

我自己改了一下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; });`

@ArgoZhang ArgoZhang self-assigned this Jan 20, 2023
@ArgoZhang ArgoZhang added the enhancement New feature or request label Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants