Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
Changing the width of browser window does not change the scroll width of onsen-carousel (onsen ui 2)
-
Hi Folks,
i would like to use the onsen-carousel for a learning module on mobile devices just the same like in web browsers. Therefor i have testet the component in firefox and google chrome in full screen mode.
I have found that changing the width of the browser window adjusted the size of the carousel-items. but the scroll width did not change.
If i change the width from 800px to 1024px, the prev and next functions do scroll 800px furthermore. To swipe over the screen also uses only 800px instead of 1024 …How can the scroll width be adjusted to the window width?
Greetings from Germany!
-
@thiudisk Hello!
ons-carousel
is not prepared to be resized in the browser since I guess it’s an uncommon use case. Carousel will probably be reworked after we finish some other stuff. If you really need to fix this, you can try to domyCarousel._currentElementSize = undefined;
beforeprev
ornext
(or onwindow.onresize
). That should force the carousel to recalculate the width of the element. Note that that’s a “private” function that can be changed with any update.
-