THAPA TECHNICAL

HOUSE OF WEB DEVELOPERS AND TECHNOLOGY.

Infinite Scrolling in React JS

window.innerHeight returns the inner height of the window (the height of the browser window's viewport), in pixels.


document.documentElement.scrollTop returns the number of pixels that the document has been scrolled vertically.


document.documentElement.scrollHeight returns the height of the entire document, in pixels.


The inner height of the window is the height of the viewable area of the webpage, which is the height of the browser window's viewport. The scroll height is the total height of the webpage, including any content that extends beyond the viewable area and requires scrolling to see.


So, window.innerHeight is the height of the viewport, document.documentElement.scrollTop is the number of pixels the document has been scrolled, and document.documentElement.scrollHeight is the height of the entire document.


DOWNLOAD SOURCE CODE ;

1 comment:

  1. Infinite scrolling in React JS is a great way to improve the user experience of a website or app. It makes it easier for users to find content and scroll through pages without having to constantly click 'next page'. expressvpn 15 month deal It also helps to reduce the number of page reloads, which can make the website more responsive and faster to use.

    ReplyDelete