ion-content

How to detect scroll reached end in ion-content component of Ionic 4?

自作多情 提交于 2019-12-11 07:48:51
问题 In Ionic v3 ion-content there was properties like "scrollTop". In Ionic v4 there are no more of this properties... How could I determine if a user reached the end of the content? https://ionicframework.com/docs/v3/api/components/content/Content/ https://ionicframework.com/docs/api/content 回答1: These features are still available they are just in a different location. After enabling it with scrollEvents , you need to use the ionScroll event and then calculate the height based on the results of

How to detect if ion-content has a scrollbar?

旧巷老猫 提交于 2019-12-10 18:39:29
问题 I want to hide or show elements when there is or there isn't a scrollbar on ion-content. More specifically, I want to show a button (to load more items in a list) when there's no scrollbar and hide it where there is a scrollbar (so the loading of more items is done by ion-infinite-scroll). My Ionic app will also be deployed to the desktop so users with large screens won't initially see a scrollbar and thus ion-infinite-scroll won't be triggered. Here's a demo that showcases the issue: home