Questions tagged [js-scrollintoview]

The Element.scrollIntoView() method scrolls the current element into the visible area of the browser window.

Syntax

element.scrollIntoView(); // Equivalent to element.scrollIntoView(true)
element.scrollIntoView(alignToTop); // Boolean arguments
element.scrollIntoView(scrollIntoViewOptions); // Object argument

MDN

https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView

Can I use?

desktop

mobile

A good answer on SO

Demo

https://jsbin.com/cuweho

162 questions
0
votes
1 answer

JavaScript scrollIntoView function does not work - the page does not scroll into the element view

I have a web page (using HTML, CSS, JavaScript, PHP) and want to write some script to scroll my page to one of elements on it. This worked well (when I clicked on the button, the page scrolled into view of search_cont element:
janka
  • 21
  • 1
  • 11
0
votes
1 answer

Function scrollIntoView doesn't work

I have a little problem with my function scrollIntoView. Indeed, it doesn't work :( This is my code: HTML
0
votes
1 answer

scrollIntoView not working when device width is less than 1200px

I am using Angular 5 and have a table where I create the table rows with an *ngFor and give them an id which is the username.
0
votes
1 answer

scrollIntoView with smooth behavior not working in chrome when raised by wheel event

It's a bit tricky to explain, so maybe the easiest way to understand the problem is to go to the site web and compare the behavior between Firefox (working perfectly as expected) and chrome (scrollIntoView is not working). Basically, I have a left…
Fla
  • 536
  • 6
  • 23
0
votes
1 answer

scrollIntoView causes WKWebView to be partially unresponsive

I'm having a problem with my hybrid iOS application, in iOS 11 beta. It is basically a web app running within a WKWebView. The problem does not exist in iOS 10, but has been introduced with iOS 11. As of beta 8, the problem is still…
Vidar S. Ramdal
  • 1,164
  • 1
  • 14
  • 38
0
votes
1 answer

scrollIntoView possible with form submit -> page refresh?

Edit: I got what I want with adding #divname to the form action. Pretty dumb that I didn't try this earlier So I want to scroll back down my page when I press the submit button and the page refreshes using JS. (or HTML CSS methods if there…
HoyHym Ho
  • 79
  • 1
  • 10
0
votes
4 answers

JavaScript Smooth Scrolling effect with scrollIntoView

Okay, I am attempting to get a single page (two divs), Primarily a splash screen, which when you click 'Enter site' it will scroll down smoothly to the 'main site', However it jumps to it, rather than smooth scrolling to the element. How can I get…
Ricky
  • 763
  • 3
  • 7
  • 29
0
votes
1 answer

Keep div (when expanded) in browser window view

I have added this script to make sure #myDiv is fully in view when expanded: document.getElementById('myDiv').scrollIntoView(); However, this sets the top of #myDiv to the top of the browser window. Is there a way to modify this, to make the bottom…
Eddy
  • 566
  • 2
  • 8
  • 28
0
votes
0 answers

SlickGrid ScrollIntoView with DataView

I am using Slickgrid and am looking at the following example: http://mleibman.github.com/SlickGrid/examples/example14-highlighting.html which makes use of the scrollIntoView() function. However that example does not use a DataView. Does anybody know…
G-Man
  • 7,232
  • 18
  • 72
  • 100
-1
votes
1 answer

How to prevent the browser window from scrolling when scrolling to item in list on page?

I have a scrollable list of elements on the page, divided into sections. Each section is associated with a tab of the section name above the list. When I click on a particular Tab, the list scrolls automatically to the section of the tabs name.
lcnw
  • 117
  • 2
  • 6
-1
votes
1 answer

ScrollIntoView is not working for I.E in reactjs?

Basically I have a time dropdown, But selected time is not scrolling, on I.E scrollIntoView if (open) { setTimeout(() => { this.props.value && this[this.props.value] && this[this.props.value].scrollIntoView({ behavior:…
1 2 3
10
11