They are both going to have the same effect.
However, as pointed out in the comments: $(window).scrollTop()
is supported by more web browsers than $('html').scrollTop()
.
More Related Contents:
- Difference between screen.availHeight and window.height()
- Have a pop up window when clicking on an image
- jQuery scrolltop firefox not working
- window.open popup getting blocked during click event
- Storing a variable in the JavaScript ‘window’ object is a proper way to use that object?
- javascript to get paragraph of selected text in web page
- $(document).scrollTop() always returns 0
- Choppy/Laggy scroll event on Chrome and IE
- PLEASE assist me.. RE: *FORM FIELDS* I want to Hide() my "type=text box" until the Other option is chosen in the dropdown option
- How do I prevent a parent’s onclick event from firing when a child anchor is clicked?
- Difference between jQuery `click`, `bind`, `live`, `delegate`, `trigger` and `on` functions (with an example)?
- Uncaught TypeError: Cannot read property ‘msie’ of undefined – jQuery tools
- Semicolon before self-invoking function? [duplicate]
- How do I synchronize the scroll position of two divs?
- JavaScript equivalent of jQuery’s extend method
- Show a progress bar for downloading files using XHR2/AJAX
- Jquery Ajax prevent fail in a deferred sequential loop
- prevent mobile default keyboard when focusing an from showing
- Get translate3d values of a div?
- Jquery: how to sleep or delay?
- How to get the html of a div on another page with jQuery ajax?
- Detect if an alert or confirm is displayed on a page
- jQuery Standards and Best Practice [closed]
- Calculate Position of selected text javascript/JQuery?
- jQuery 3 slim ajax basic example
- Trigger events when the window is scrolled to certain positions
- Get content of span
- Changing the page title with Jquery
- How to iterate a table rows with JQuery and access some cell values?
- How can I compare two color values in jQuery/JavaScript?