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
283
votes
14 answers

Smooth scroll to div id jQuery

I've been trying to get a scroll to div id jquery code to work correctly. Based on another stack overflow question i tried the following DEMO http://jsfiddle.net/kevinPHPkevin/8tLdq/ $('#myButton').click(function() { $.scrollTo($('#myDiv'),…
StevenPHP
  • 3,047
  • 3
  • 15
  • 17
282
votes
17 answers

How to scroll HTML page to given anchor?

I’d like to make the browser to scroll the page to a given anchor, just by using JavaScript. I have specified a name or id attribute in my HTML code: .. or

..

I’d like to get the same effect as…
Juha Syrjälä
  • 30,987
  • 31
  • 122
  • 175
271
votes
18 answers

Changing route doesn't scroll to top in the new page

I've found some undesired, at least for me, behaviour when the route changes. In the step 11 of the tutorial http://angular.github.io/angular-phonecat/step-11/app/#/phones you can see the list of phones. If you scroll to the bottom and click on one…
Matias Gonzalez
  • 2,911
  • 2
  • 12
  • 8
267
votes
30 answers

How to disable RecyclerView scrolling?

I cannot disable scrolling in the RecyclerView. I tried calling rv.setEnabled(false) but I can still scroll. How can I disable scrolling?
Zsolt Safrany
  • 11,950
  • 5
  • 48
  • 57
263
votes
13 answers

How to scroll to specific item using jQuery?

I have a big table with vertical scroll bar. I would like to scroll to a specific line in this table using jQuery/JavaScript. Are there built-in methods to do this? Here is a little example to play with. div { width: 100px; height: 70px; …
Misha Moroshko
  • 148,413
  • 200
  • 467
  • 700
256
votes
4 answers

CSS - Overflow: Scroll; - Always show vertical scroll bar?

So currently I have: #div { position: relative; height: 510px; overflow-y: scroll; } However I don't believe that it will be obvious to some users that there is more content there. They could scroll down the page without knowing that my div…
Jambo
  • 2,607
  • 2
  • 15
  • 15
253
votes
45 answers

Making a UITableView scroll when text field is selected

After a lot of trial and error, I'm giving up and asking the question. I've seen a lot of people with similar problems but can't get all the answers to work right. I have a UITableView which is composed of custom cells. The cells are made of 5 text…
Jonathan
252
votes
9 answers

How to disable scrolling in UITableView table when the content fits on the screen

I have a few (grouped style) tables in my iphone app (only on part of the screen and added with Interface Builder though, not subclassed from UITableViewController) that 80% of the time are small and will fit on the screen. When the table fits on…
Ginny
  • 2,921
  • 2
  • 15
  • 12
243
votes
17 answers

Scroll RecyclerView to show selected item on top

I'm looking for a way to scroll a RecyclerView to show the selected item on top. In a ListView I was able to do that by using scrollTo(x,y) and getting the top of the element that need to be centered. Something like: @Override public void…
Distwo
  • 10,755
  • 7
  • 38
  • 60
230
votes
9 answers

How to get scrollbar position with Javascript?

I'm trying to detect the position of the browser's scrollbar with JavaScript to decide where in the page the current view is. My guess is that I have to detect where the thumb on the track is, and then the height of the thumb as a percentage of the…
Paul
  • 2,303
  • 2
  • 14
  • 5
228
votes
9 answers

jQuery Scroll to bottom of page/iframe

How do I use jquery to scroll right down to the bottom of an iframe or page?
Adam
  • 8,334
  • 14
  • 41
  • 57
226
votes
33 answers

Scroll to the top of the page after render in react.js

I have a problem, which I have no ideas, how to solve. In my react component I display a long list of data and few links at the bottom. After clicking on any of this links I fill in the list with new collection of the links and need to scroll to the…
Andrew Kovalenko
  • 4,873
  • 2
  • 24
  • 40
224
votes
35 answers

Scroll Element into View with Selenium

Is there any way in either Selenium 1.x or 2.x to scroll the browser window so that a particular element identified by an XPath is in view of the browser? There is a focus method in Selenium, but it does not seem to physically scroll the view in…
Dan at Demand
  • 2,849
  • 3
  • 17
  • 10
215
votes
30 answers

Prevent scrolling of parent element when inner element scroll position reaches top/bottom?

I have a little "floating tool box" - a div with position:fixed; overflow:auto. Works just fine. But when scrolling inside that box (with the mouse wheel) and reaching the bottom OR top, the parent element "takes over" the "scroll request" : The…
T4NK3R
  • 3,953
  • 2
  • 19
  • 23
211
votes
15 answers

How to scroll to an element inside a div?

I have a scrolled div and I want to have an event when I click on it, it will force this div to scroll to view an element inside. I wrote its JavasSript like this: document.getElementById(chr).scrollIntoView(true); but this scrolls all the page…
Amr Elgarhy
  • 59,046
  • 67
  • 178
  • 291