Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to jump to top of a specific part of page using JS

Soukaina IDRISSIJan 5 2018 — edited Jan 7 2018

Hi everybody,

i want to scroll to top of a specific region (static ID= telClt_sc) on same tab,

For that i did this piece of JS code:

Code 1:

/* Jump To Specific Region: id='telClt_sc' */

var element = document.getElementById("telClt\_sc");

element.scrollIntoView({block: "start", behavior: "smooth"}); 

Or , Code 2:

$("html, body").animate({ scrollTop: $("#telClt_sc").offset().top }, 1500);

When i run page to test it, the page is scrolled in the middle of region, not in the top of region

result.PNG

This post has been answered by fac586 on Jan 6 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2018
Added on Jan 5 2018
10 comments
1,252 views