Questions tagged [scroll]

Scrolling refers to the continuous sliding of content across a display screen.

Scrolling generally occurs on the horizontal and vertical axes. In addition scrolling can be accomplished via mouse, trackpad, trackball and the keyboard.

Wikipedia article: http://en.wikipedia.org/wiki/Scrolling

20210 questions
210
votes
7 answers

Scroll to a div using jQuery

so I have a page that has a fixed link bar on the side. I'd like to scroll to the different divs. Basically the page is just one long website, where I'd like to scroll to different divs using the menu box to the side. Here is the jQuery I have so…
tshauck
  • 16,510
  • 7
  • 32
  • 36
189
votes
9 answers

How to detect scroll position of page using jQuery

I am having trouble with jQuery functionality on my website. What it does, is that it uses the window.scroll() function to recognize when the windows changes its scroll position and at the change calls a few functions to load data from the…
Maven
  • 12,338
  • 35
  • 95
  • 148
173
votes
23 answers

How to scroll to the bottom of a RecyclerView? scrollToPosition doesn't work

I'd like to scroll to the bottom of the RecyclerView list after loading the activity. GENERIC_MESSAGE_LIST = (ArrayList) intent.getExtras().getParcelableArrayList(ConversationsAdapter.EXTRA_MESSAGE); conversationView = (RecyclerView)…
waylaidwanderer
  • 1,851
  • 2
  • 13
  • 9
172
votes
5 answers

Have a fixed position div that needs to scroll if content overflows

I have actually two issues, but lets resolve the primary issue first as I believe the other is easier to address. I have a fixed position div on the left side of the scroll for a menu. Right side is a standard div that scrolls properly. The issue is…
TCD Factory
  • 1,834
  • 2
  • 13
  • 11
171
votes
6 answers

Disable Scrolling on Body

I would like to disable scrolling on the HTML body completely. I have tried the following options: overflow: hidden; (not working, did not disable scrolling, it just hid the scrollbar) position: fixed; (this worked, but it scrolled completely to…
user4532193
167
votes
28 answers

How to scroll to top of page with JavaScript/jQuery?

Is there a way to control browser scrolling with JavaScript/jQuery? When I scroll my page half way down, then trigger a reload, I want the page to go pack to the top, but instead it tries to find the last scroll position. So I did…
Yarin
  • 144,097
  • 139
  • 361
  • 489
165
votes
10 answers

Programmatically scroll a UIScrollView

I have a UIScrollView which has several views. When a user flicks their finger, the view scrolls to the right or left depending on the direction of the finger flick. Basically my code works in a way similar to the iPhone photo app. Now, is there a…
climbon
  • 2,133
  • 4
  • 16
  • 17
164
votes
24 answers

How to programmatically disable page scrolling with jQuery

Using jQuery, I would like to disable scrolling of the body: My idea is to: Set body{ overflow: hidden;} Capture the current scrollTop();/scrollLeft() Bind to the body scroll event, set scrollTop/scrollLeft to the captured value. Is there a…
Hailwood
  • 79,753
  • 103
  • 257
  • 412
162
votes
9 answers

jQuery load more data on scroll

I am just wondering how can i implement more data on scroll only if the div.loading is visible. Usually we look for page height and scroll height, to see if we need to load more data. but the following example is little complicated then…
Basit
  • 13,920
  • 29
  • 88
  • 145
154
votes
11 answers

Detecting scroll direction

So I am trying to use the JavaScript on scroll to call a function. But I wanted to know if I could detect the direction of the the scroll without using jQuery. If not then are there any workarounds? I was thinking of just putting a 'to top' button…
dwinnbrown
  • 3,013
  • 7
  • 27
  • 53
145
votes
15 answers

Scroll back to the top of scrollable div

#containerDiv { position: absolute; top: 0px; width: 400px; height: 100%; padding: 5px; font-size: .875em; overflow-y: scroll; } document.getElementById("containerDiv").innerHTML = variableLongText; How…
imhere
  • 3,025
  • 7
  • 23
  • 25
144
votes
2 answers

Remove RecyclerView scroll effects

I have two RecyclerView inside my NavigationDrawer. Both have the blue scroll effects. How can I remove this effect in both RecyclerViews? I tried changing: mRecyclerView.setHasFixedSize(true); to false, but it remove scroll effects. (What is the…
JavierSegoviaCordoba
  • 5,841
  • 7
  • 32
  • 48
141
votes
8 answers

Hide keyboard when scroll UITableView

In my app i want hide keyboard when i start scrolling UITableView. I search about this in internet, and most answer is subclassing UITableView (http://stackoverflow.com/questions/3499810/tapping-a-uiscrollview-to-hide-the-keyboard). I made subclass…
olegi
  • 2,001
  • 3
  • 16
  • 9
140
votes
13 answers

RecyclerView - How to smooth scroll to top of item on a certain position?

On a RecyclerView, I am able to suddenly scroll to the top of a selected item by using: ((LinearLayoutManager) recyclerView.getLayoutManager()).scrollToPositionWithOffset(position, 0); However, this abruptly moves the item to the top position. I…
137
votes
22 answers

scrollIntoView Scrolls just too far

I have a page where a scroll bar containing table rows with divs in them is dynamically generated from the database. Each table row acts like a link, sort of like you'd see on a YouTube playlist next to the video player. When a user visits the page,…
Matthew Wilson
  • 1,375
  • 2
  • 9
  • 5