$(window).scroll event does not fire


Harald Schneider

I tried to implement some kind of elevator button, which allows the user to scroll back to top at the end of long lists or texts. The button should appear automatically after the user scrolled e.g. 100px downwards and disappear, if the list has reached its top again.

Example here: https://codepen.io/rdallaire/pen/apoyx

However, it looks like Angular supresses the scroll event: https://stackoverflow.com/questions/33600605/window-scroll-not-working-in-augular-controller

Do you see any chance to get this working? Or maybe add a custom control for this functionality?


DecSoft

Hello Harald,

Probably what happen is that we must adapt the code to our app. For example, copy the below text and save it as a file named "TopLink.ab". Open that file with App Builder and run the app. As you can see, there is no problem to use the code that you wanted (or better said, to get the results that you wanted) using an HTML control, for example. I am not sure, however, if you wanted something like this or other thing.

The CSS code has been placed in the app's Inline CSS option. The Javascript (adapted) has been placed in the app's view Show event. Below is what you must see when run the app:



DecSoft

Hello Harald,

Here is another sample, this time scrolling the app's view itself, not an specific HTML Content control. Instead of refer to "window", we refer to ".appView", which is a class that all the views have. Take a look at the same parts than in the above sample.

Here is how this sample look:



Harald Schneider
Perfect! You saved my day :-) Thank you!

Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.