Try this fiddle, it is working in chrome, ie and the latest version of mozilla : http://jsfiddle.net/Hed2J/3/
I replace $('body').scrollTop()
with $(window).scrollTop()
.
More Related Contents:
- $(window).scrollTop() vs. $(document).scrollTop()
- $(document).scrollTop() always returns 0
- Choppy/Laggy scroll event on Chrome and IE
- Download the text over image using jquery
- $(document).ready equivalent without jQuery
- How to tell if browser/tab is active [duplicate]
- jQuery – setting the selected value of a select control via its text description
- Listening for variable changes in JavaScript
- Chrome Uncaught Syntax Error: Unexpected Token ILLEGAL [duplicate]
- JS replace not working on string [duplicate]
- jqGrid add new column
- What is the difference between setTimeout(fn, 0) and setTimeout(fn, 1)?
- Is it possible to check dimensions of image before uploading?
- javascript – How to make this code work? [duplicate]
- Userscript to wait for page to load before executing code techniques?
- In jQuery, what’s the best way of formatting a number to 2 decimal places?
- what’s the equivalent of jquery’s ‘trigger’ method without jquery?
- How to expire a cookie in 30 minutes using jQuery?
- how to assign javascript variable value to php variable
- Javascript: do an action after user is done scrolling
- Detect which form input has focus using JavaScript or jQuery
- Stop all playing iframe videos on click a link javascript
- XMLHttpRequest cannot load, No ‘Access-Control-Allow-Origin’ header is present on the requested resource [duplicate]
- jQuery – Create hidden form element on the fly
- jQuery: checking if the value of a field is null (empty)
- Sum numbers returns NaN
- lodash debounce not working in anonymous function
- Is there an equivalent to e.PageX position for ‘touchstart’ event as there is for click event?
- window.open() simply adds the url to my current url
- Replacing selected text in the textarea