Please tell me about the <ons-carousel> method.

Asked 1 years ago, Updated 1 years ago, 65 views

ons-carousel method has been tried.
Can I get the following information from ons-carousel?

If you know the above information, please let me know.

javascript jquery onsen-ui angularjs cordova

2022-09-30 18:35

2 Answers

The number of elements seems to be available below.
_getCarouselItemCount()

However, as you can see, this method is for internal use in OnsenUI, so you should be prepared to change the name or delete it in future versions.

After that, you can get the current index number (a number starting with 0), so you can determine if it is the last item compared to the number of elements obtained in the above method.


2022-09-30 18:35

ons-carousel-item to get only the number of elements
document.getElementsByTagName('ons-carousel-item') .length
I think it's okay to say that.


2022-09-30 18:35

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.