WPF Listbox auto scroll while dragging

Got it. Used the event DragOver of the ListBox, used the function found here to get the scrollviewer of the listbox and after that its just a bit of juggling with the Position. private void ItemsList_DragOver(object sender, System.Windows.DragEventArgs e) { ListBox li = sender as ListBox; ScrollViewer sv = FindVisualChild<ScrollViewer>(ItemsList); double tolerance = 10; double … Read more

Jquery if scroll is a certain amount of pixels

You can check $(document).scrollTop() inside of a scroll handler: var $document = $(document), $element = $(‘#some-element’), className=”hasScrolled”; $document.scroll(function() { if ($document.scrollTop() >= 50) { // user scrolled 50 pixels or more; // do stuff $element.addClass(className); } else { $element.removeClass(className); } }); If adding the class name is all you want (no other actions needed), this … Read more