scroll
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
Smooth scroll to anchor after loading new page
As browsers automatically detect the hash and take you to that position… It occurs to me that you could first reset the scroll position to 0 and then made the smooth scrolling. Something like… // to top right away if ( window.location.hash ) scroll(0,0); // void some browsers issue setTimeout( function() { scroll(0,0); }, 1); … 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
Enable smooth scrolling for my website in all browsers
I found two jQuery plugins that may do what you want. Simplr-SmoothScroll // Source: SE Question jQuery SmoothWheel edit: Struck out SmoothWheel because of comments – it hasn’t been updated in ages, and SmoothScroll seems well maintained.
Enable scroll for WPF Treeview
The TreeView control itself includes a ScrollViewer in its template. You should be able to just use a TreeView inside an appropriate host (not a StackPanel!).