| Page 1 of 1 | [ 4 posts ] |
|
I'm a YUI 3 beginner, I used to use YUI 2 a lot.
I'm trying to set up a ScrollView in my mobile application. However, I encounter a strange behavior with the ScrollView, but I'm not sure if it should be considered as a bug. In my application, I want a scrollview to fill the remaining space of the screen. In order to implement this functionality, whenever the browser window is resized, I update the height of the scrollview to the appropriate value using the windowresize event. However, when the screen is resized big enough so that no scrollbars are necessary anymore, the content keep being "scrolled" (but is not scrollable anymore), and consequently, there's no way to view the hidden content. So: 1. is this a bug? 2. how can I workaround this issue? FWIW, I use YUI 3.4.0, here is the code: http://pastie.org/2455149 |
|
Anyone?
|
|
I finally found out a way to avoid this bad behavior by clamping the scroll position when the scrollview is resized:
Code: // fix the scroll position var scrollY = scrollview.get('scrollY'), maxScrollY = scrollview._maxScrollY || 0; if (scrollY > maxScrollY) { scrollview.set('scrollY', maxScrollY); } |
|
For those interested, here is the relevant issue in the bug tracker:
http://yuilibrary.com/projects/yui3/ticket/2531135 |
| Page 1 of 1 | [ 4 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group