var distance = $('div').offset().top,
$window = $(window);
$window.scroll(function() {
if ( $window.scrollTop() >= distance ) {
// Your div has reached the top
}
});
P.S. For better performance, you should probably throttle the scroll event handler.
Check out John Resig’s article: Learning from Twitter.
Related Contents:
- jQuery how to find an element based on a data-attribute value?
- jQuery disable a link
- jQuery select change event get selected option
- JQuery: detect change in input field [duplicate]
- jquery 3.0 url.indexOf error
- jQuery If DIV Doesn’t Have Class “x”
- jQuery hasClass() – check for more than one class
- Select element by exact match of its content
- jquery UI Sortable with table and tr width
- angular.element vs document.getElementById or jQuery selector with spin (busy) control
- Auto expand a textarea using jQuery
- Can you autoplay HTML5 videos on the iPad?
- jQuery How to Get Element’s Margin and Padding?
- jQuery and TinyMCE: textarea value doesn’t submit
- Change Active Menu Item on Page Scroll?
- jQuery Validate – require at least one field in a group to be filled
- Can I keep Nuget on the jQuery 1.9.x/1.x path (instead of upgrading to 2.x)?
- How to set width and height dynamically using jQuery
- Disable form submission via Enter key on only _some fields
- How to access JSON Object name/value?
- Selecting option by text content with jQuery
- JQuery change inner text but preserve html
- Does Twitter Bootstrap include jQuery?
- Multiple selector chaining in jQuery?
- Detect when input has a ‘readonly’ attribute
- How to decode character pressed from jQuery’s keydown()’s event handler
- Finding the position of bottom of a div with jquery
- Clear text area
- Can I use jQuery find() for more than one element type at the same time?
- Detect Enter key is pressed with jQuery
- How to make a checkbox checked with jQuery? [duplicate]
- jQuery UI Autocomplete widget search configuration
- How to add jQuery to JSfiddle
- Synchronous XMLHttpRequest warning and
- Choosing a jQuery datagrid plugin? [closed]
- The specified value does not conform to the required format yyyy-MM-dd
- What is the difference between fetch and jquery ajax?
- need click twice after hide a shown bootstrap popover
- Find a string of text in an element and wrap some span tags round it
- success callback after knockout.js finishes rendering all the elements
- How do I use jQuery to select all children except a select element
- Uncaught TypeError: Cannot set property ‘nTf’ of undefined
- disable enter key on specific textboxes
- How to set encoding in .getJSON jQuery
- jQuery match multiple attributes
- Webpack: how to make angular auto-detect jQuery and use it as angular.element instead of jqLite?
- How to get only direct text without tags with jQuery in HTML
- jQuery check if Cookie exists, if not create it
- jQuery: Hide popup if click detected elsewhere
- how to make colorbox responsive