2

I have a div with IScroll inside another div with IScroll. Whenever I try to make scroll on the child div, the parent scrolls too, so it's an awful user experience.

I would like not to get every variable and telling it to disable it temporally, such as in this other question, because they are dynamic content and the scrollers are created inside a class - so there are not global variables storing the scroller.

I have visited this question but whenever I try to catch the event, it's undefined so it raises an error. It seems that IScroll 5 does not send the event to the handlers, so I cannot write event.stopPropagation(), because it does nothing.

I've tried with all the events IScroll provides, and even I have tried to switch back to iScroll 4 and trying onBeforeScrollStart and so on, also without luck.

The solution should be able to work on touch enabled devices, but also with mouse interaction (drag) and mousewheel.

Is it possible? If so, what can I do so the parent scroller stops from scrolling if it's the child who is getting the scroll action?

Thank you.

Community
  • 1
  • 1
Unapedra
  • 2,043
  • 4
  • 25
  • 42

1 Answers1

1

You can try JRoll, it has a method call, call can switch current scroll instance. Inside div switch to outside div, you don't use e.preventDefault or e.stopProgapation. Here has a demo http://www.chjtx.com/JRoll/demos/5.html

General Grievance
  • 4,555
  • 31
  • 31
  • 45
BarZu
  • 11
  • 3