ngx drag scroll loop
MFOFANA154 opened this issue · 14 comments
-
I'm submitting a ...
- bug report
- feature request
- support request => Please do not submit support request here, see note at the top of this template.
-
Do you want to request a feature or report a bug?
I would like to know if it's possible to create a loop picture with your module.
Because at the moment i tried to create it like this :
ngOnInit() {
this.boucleImage();
}
boucleImage() {
// Starting ngx-drag-scroll from specified index(3)
if (this.index === 0) {
setTimeout(() => {
this.ds.moveTo(2);
}, 3000);
} else {
setTimeout(() => {
this.ds.moveTo(0);
}, 3000);
}
setTimeout(() => this.boucleImage(), 1000);
}
but i want to do this loop in a way and not back and forth.
-
What is the current behavior?
-
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem you can use the demo site as an example or via https://plnkr.co
-
What is the expected behavior?
-
What is the motivation / use case for changing the behavior?
-
Please tell us about your environment:
- Version: 1.0.0
- Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
all
- Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
Could you elaborate on what you're trying to achieve / what the problem is? When you say you're trying to make a "loop picture", what behaviour are you looking for exactly?
If your question is more general than being strictly an issue with or feature request for ngx-drag-scroll, consider asking on a forum like StackOverflow to get more exposure to people looking to suggest solutions.
Hi, do you have any idea of why you can't drag the images of any part of the page to my desktop, that is, the complement drag-scroll blocks all the images on the page, is there a way to correct that?
Hi @bfwg , do you have any idea of why you can't drag the images of any part of the page to my desktop, that is, the complement drag-scroll blocks all the images on the page, is there a way to correct that?
Can you give me an example? @arman2r plnker whould be nice
Thanks @bfwg for your prompt response, I do not have an example in plunker, but the simple case of replicating, just try to drag an image that is outside the drag-scroll and you will realize that the image does not drag is as if a layer invisible will block all content and therefore cannot be saved on the pc
I believe this is where the issue is. We should add the on drag listener on the carousel, not the global document.
I’m pretty busy today, but I can quickly do the dev review if you are free to throw in a Pull Request. If not, I’ll find time to patch it up later today or tomorrow.
@bfwg How can I get to correct the initialization of the component by specifying the parent element or div of the scroll-drag so that it does not take the whole document.
Try placing the code in an ngAfterViewInit but apparently the component starts only and before the afterViewInit arrives, any ideas?
Have you tried changing the listener to this._contentRef.nativeElement
this._onDragStartListener = this._renderer.listen(this._contentRef.nativeElement, 'dragstart', (e) => {
e.preventDefault();
});
@bfwg I applied that function and initialized it on the onInit but I didn't get any changes,
I could not achieve the native dragging of browser images to drop them in my desk,
This image is an example of what I want to achieve
Looks like this is dead but I am struggling to make this working, there is no problem with removing items from the start and imediatelly add them at the end. The problem here which I am facing is with scrollbar jumping. Some people suggested to use fixed position once the element ref scroll is changed but it is very frustrating. Anyone has any idea how this could be implemented?
@bfwg I think I have almost done the feature implementation for this one. It also fixes the index problem. I would like to open a PR but I am not a contributor on this
@Coldplayer1995 you are welcome to open a PR, and I will merge it for you. You will become a contributor of this project once the first PR merges.
Happy new year and I'm looking forward working with you on your PR.