0

I'm trying to add a class to an element when I scroll down and remove this class when I scroll up my .NET Blazor Web Assembly App. The desktop version is working well (using WheelEventArgs - DeltaY property) but the problem is the code is not working on mobile devices (probably because I listen to Mouse Event and mobile has touch screen, not mouse).

Blazor documentation for WheelEventArgs.DeltaY Property https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.web.wheeleventargs.deltay?view=aspnetcore-7.0#microsoft-aspnetcore-components-web-wheeleventargs-deltay

I don't want to use JavaScript. Just C#.

Is there any way to check if I scroll the page up or down on mobile devices? Something like DeltaY for mouse wheel but touch screen version? I can't find any info in documentation.

Robur
  • 101
  • 1
  • 3

0 Answers0