Questions tagged [onscroll]

The onscroll is HTML DOM event occurs when an element's scrollbar is being scrolled.

The onscroll is HTML DOM event occurs when an element's scrollbar is being scrolled.

Useful links

334 questions
8
votes
6 answers

Lower the frequency of Javascript event polling

How do you lower the frequency of Javascript event polling? The events I'm concerned about are onResize and onScroll. These events may be triggered dozens of times per second when someone resizes their browser or scrolls down, respectively. I'd like…
JoJo
  • 19,587
  • 34
  • 106
  • 162
6
votes
1 answer

My scroll handler JavaScript doesn't work in Internet Explorer

I have a script on my site that works in every browser, except Internet Explorer. Can someone explain why this doesn't work? var header = document.getElementById('header'); var picturebg = document.getElementsByClassName('picturebg')[0]; var…
r4tchet
  • 157
  • 1
  • 2
  • 8
6
votes
1 answer

Weird onScroll event triggered after onScale event

I have an app that uses a SimpleOnScaleGestureListener and a SimpleOnGestureListener together. Whenever I do a pinch zoom I get the expected onScale's, but when I lift off I see a weird onScroll that has a start position from the beginning of the…
William T. Mallard
  • 1,562
  • 2
  • 25
  • 33
5
votes
1 answer

Android: How to invoke programmatically onScroll event in ListView

I am trying to invoke programmatically onScroll event in ListView. Can anybody help me? Here my code: @RunWith(RobolectricTestRunner.class) public class ActivityListViewTest { private ActivityListView activity; @Before public void…
ihrupin
  • 6,932
  • 2
  • 31
  • 47
5
votes
4 answers

is this possible to get scroll position in material-ui select list on Scroll?

is it possible to get scroll position in material-ui list on Scroll, if so, how? I am trying to add infinite scroll on the select list since I have 5300 elements and it takes forever to render all those elements.
dawood11
  • 93
  • 2
  • 2
  • 6
5
votes
1 answer

onscroll won't work with IE

i have a "body" with onScroll="Scroll()". Scroll method should, well, scroll some div as user scrolls the page. Scroll(): function Scroll() { var el = document.getElementById('controlBox'); var ScrollTop = document.body.scrollTop; …
guest86
  • 2,894
  • 8
  • 49
  • 72
5
votes
1 answer

Android - onScroll Gesture Detector

I want to implement onScroll, when scroll event occurs. However I don't understand how can I detect the scroll from bottom up with the parameters that I receive with onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY). I would…
Vera
  • 171
  • 2
  • 12
5
votes
1 answer

onScale and Canvas - how to adjust origin point after zooming image?

I have a very simple test app with a custom component MyView.java - which displays a scrollable and scalable image (representing a board in a Scrabble-like word game): 1) In my scale listener I adjust the scale factor: public boolean…
Alexander Farber
  • 21,519
  • 75
  • 241
  • 416
5
votes
1 answer

onScrollChanged() never fired on Android 4.0

I have a GridView that shows images from your gallery. When user scrolls the list, details about the image animate in from the left. I implemented this in the class that defines custom layout for the GridView item. It extends…
5
votes
1 answer

Android Using GridView with OnScrollListener

I'm building a gridview that contains alot of images likely around 1000++ pictures. To reduce the loading time for the gridview, I want to implement an onScrollListener using AbsListView. I will limit 20 images per view, then when scrolling reaches…
KC Chai
  • 1,607
  • 9
  • 30
  • 59
4
votes
3 answers

How do i subscribe to onscroll event in Blazor?

I am trying to react to the onscroll event in Blazor to animate an image when the user scrolls down the web page (something like the brand logo on this website: https://lebenswelten-stgabriel.at/). I have tried the native onscroll events and also…
JP-P
  • 151
  • 1
  • 5
4
votes
3 answers

My onscroll event is not firing my java script function

I'm trying to say in my code that if the user scrolls down 250px, I want the data-percent to go from 0% to 100% and this is done in "myFunction". I am still new to JS so I'm having trouble understanding why it's not working when I scroll past 250px.…
Will
  • 309
  • 1
  • 4
  • 13
4
votes
2 answers

React.js Call function after scroll event

I have built a React component which is suppose to call the function on window scroll event. I would like to call the function, "getCards('default'), when the user scroll to 90% of the scroll height. The component looks as shown in below: class…
Eunicorn
  • 601
  • 6
  • 16
  • 29
4
votes
1 answer

ReactJS: Issue with using setState() with onScroll()

I have a React app with basically a fixed header -- -- and the rest of the content -- . What I'm trying to do is add a drop shadow to the when the window is scrolled. So I'm attaching an onScroll handler to a DIV…
accelerate
  • 1,215
  • 3
  • 16
  • 30
4
votes
2 answers

How can I prevent onscroll function to trigger during resize?

I have two event handlers defined: window.onresize = repositionElements; scrollElement.onscroll = handleScrollBusiness; Now, when I resize the window, I do not want my onscroll event to fire (which it ususally does during resizing). So I thought I…
mdomino
  • 1,195
  • 1
  • 8
  • 22
1
2
3
22 23