Enabling data-zoom then also lets the user scroll horizontally even though the content does not expand beyond the screens horizontal limit.
Is there a way to have data-zoom enabled, but not let the user scroll if the content is "zoomed out"?
(It gets very annoying if the user scrolls to get down the page, and in addition to scrolling downward, the text also moves back and forth horizontally.)
5 Answers, 1 is accepted
If I understand you correctly, you are looking for the scrolling behavior of the iOS browser (locking the scrolling axis for each swipe). Such feature is not available currently - I would like to recommend that you suggest it in our uservoice tracker - we will consider it for future releases.
Greetings,Petyo
the Telerik team
I'm not sure if I expressed myself clear enough. This issue is the same for both iOs and Android.
In the view I have content that fits the width of the screen. There is no need for horizontal scrolling. With data-zoom="false" everything works fine.
However I wish to enable the user to use pinch-and-zoom if he wants to zoom in. If I set data-zoom="true", the zoom option is enabled. However - at the same time - horizonal scroll is enabled, causing the content to move to the left and to the right as the user scrolls further down the page (also when the page is zoomed out). This is very annoying.
So the question is - is it able to enable pinch-and-zoom, and at the same time avoid this unfortunate side effect?
I've attached a picture to explain.
Thank you for the additional clarifications. The lock behaviour I initially described was means to avoid the undesired effect you describe, without actually disabling the horizontal scrolling hint. Unfortunately, I can't suggest a workaround for this behaviour, currently. If the uservoice suggestion gathers some votes, we will revisit this implementation for future releases.
I am sorry for the inconvenience,
Telerik
Would it be possible to enable/disable the data-zoom feature programmatically?
Allowing the user to toggle the zoom feature would be a nice workaround.
I checked the codebase for such option. The zoom configuration option is parsed when the scroller is initialized in order to attach event listeners to gestures like pinch and zoom. Enabling and disabling those handlers is not exposed as (even internal) convenient method which I could suggest.
I am sorry for the inconvenience caused.
Petyo
Telerik