Skip to main content
Active reading.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 109
  • 132

How to scroll an HTML page to a given anchor?

How to scroll an HTML page to a 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:

 <a name="anchorName">..</a>

or

 <h1 id="anchorName2">..</h1>

I’d like to get the same effect as you’d get by navigating to http://server.com/path#anchorName. The page should be scrolled so that the anchor is near the top of the visible part of the page.

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:

 <a name="anchorName">..</a>

or

 <h1 id="anchorName2">..</h1>

I’d like to get the same effect as you’d get by navigating to http://server.com/path#anchorName. The page should be scrolled so that the anchor is near the top of the visible part of the page.

How to scroll an HTML page to a 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:

 <a name="anchorName">..</a>

or

 <h1 id="anchorName2">..</h1>

I’d like to get the same effect as you’d get by navigating to http://server.com/path#anchorName. The page should be scrolled so that the anchor is near the top of the visible part of the page.

Question Protected by Ciro Santilli OurBigBook.com
Removed tag from title; grammar; spelling.
Source Link
Sebastian Simon
  • 19k
  • 8
  • 60
  • 82

How to scroll HTML page to given anchor using jQuery or Javascript?

IdI’d like to make the browser to scroll the page to a given anchor, just by using javascriptJavaScript.

I have specified namea name or idid attribute in my htmlHTML code:

 <a name="anchorName">..</a>

or

 <h1 id="anchorName2">..</h1>

I'dI’d like to get the same effect as youyou’d get by navigating to http://server.com/path#anchorNamehttp://server.com/path#anchorName. The page should be scrolled so that the anchor is near the top of the visible part of the page.

How to scroll HTML page to given anchor using jQuery or Javascript?

Id like to make browser to scroll page to given anchor, just by using javascript.

I have specified name or id attribute in my html code:

 <a name="anchorName">..</a>

or

 <h1 id="anchorName2">..</h1>

I'd like get same effect as you get by navigating to http://server.com/path#anchorName. The page should be scrolled so that the anchor is near top of visible part of page.

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:

 <a name="anchorName">..</a>

or

 <h1 id="anchorName2">..</h1>

I’d like to get the same effect as you’d get by navigating to http://server.com/path#anchorName. The page should be scrolled so that the anchor is near the top of the visible part of the page.

Source Link
Juha Syrjälä
  • 34k
  • 33
  • 134
  • 189

How to scroll HTML page to given anchor using jQuery or Javascript?

Id like to make browser to scroll page to given anchor, just by using javascript.

I have specified name or id attribute in my html code:

 <a name="anchorName">..</a>

or

 <h1 id="anchorName2">..</h1>

I'd like get same effect as you get by navigating to http://server.com/path#anchorName. The page should be scrolled so that the anchor is near top of visible part of page.