This is a migrated thread and some comments may be shown as answers.

Enabling zoom without enabling unnecessary scroll

5 Answers 155 Views
Application
This is a migrated thread and some comments may be shown as answers.
Robin
Top achievements
Rank 1
Robin asked on 08 May 2013, 10:05 AM
I have made an app where I have set data-zoom="true" for some of the views.

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

Sort by
0
Petyo
Telerik team
answered on 10 May 2013, 05:27 AM
Hi Robin,

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
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Robin
Top achievements
Rank 1
answered on 23 May 2013, 10:49 AM
Hi again Petyo! 

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. 

0
Petyo
Telerik team
answered on 26 May 2013, 05:24 PM
Hello Robin,

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,

Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Robin
Top achievements
Rank 1
answered on 26 May 2013, 07:48 PM
Thank you Petyo!

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.
0
Petyo
Telerik team
answered on 29 May 2013, 06:16 AM
Hello Robin,

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. 

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Application
Asked by
Robin
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Robin
Top achievements
Rank 1
Share this question
or