user1922139
user1922139

Reputation: 13

window.location.hash anchor links with in HTML page

need a fix for my below question. would be great if any one suggest me..

my html page contains header div which is fixed. & below the fixed header div I have content div. content div is having more content with internal anchor links. so when I click on the page links the content is starting from windows top position. Because I have used "window.location.hash". So its starting from top & internal links are not showing up correctly. So can anyone plz give me a solution to make this content links to appear below the fixed header div ``

Upvotes: 0

Views: 947

Answers (1)

marteljn
marteljn

Reputation: 6516

If you are dealing with a fixed header as you said, you may need to use window.scrollTo instead of hash tags. The Y position will be how many pixels down the page you would like to scroll to.

window.scrollTo(x,y);

Upvotes: 1

Related Questions