I have a div with a scrollbar in the main window who has also a scrollbar. So, if I use window.scrollbar then it will return the scrolling position of the main scrollbar or my div window’s scrollbar? What I need to write if I want to know the position of both the scrollbars? Please explain so it will help me in understanding the stuffs such as frames and window.
Share
window.scrollbardoesn’t exist AFAIK, it may be some IE specific thing, but it’s certainly not standard.window.scrollbarssimply gives you information about whether or not the scrollbar is visible on the page.You want, I believe,
document.body.scrollTopwhich tells you how far the page is scrolled, ordiv.scrollTopon your div.