question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scrollX/Y for things other than window

See original GitHub issue

Is there a reason why there’s no bind:scrollX for dom nodes ? I see there are for window. I rolled my own solution, but it felt like it should be supported!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:18
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
Rich-Harriscommented, Nov 11, 2019

I like this, I’ve wanted it a couple of times myself. Opened #3895. It uses scrollLeft and scrollTop as the binding names, rather than making it consistent with <svelte:window> but inconsistent with the DOM

3reactions
weepycommented, Mar 10, 2022

Here’s my little action :

	const scrollLeft = writable(0)

	export function scrollX(node, store) {
	
		store.subscribe(val => node.scrollLeft = val)

		node.addEventListener('scroll', (e) => {
			store.set(e.target.scrollLeft)
		})
	}

use like:

<div use:scrollX={scrollLeft}> ...
Read more comments on GitHub >

github_iconTop Results From Across the Web

Scroll Inactive Windows by Hovering Over Them - groovyPost
Windows 10 includes a new feature that allows you to scroll through documents or web pages without the focus being on the window....
Read more >
Windows 10 Tip: Scroll Inactive Windows - Thurrott.com
Windows 10 has a neat new feature that lets you scroll in non-active windows on the desktop, just as with the Mac. Here's...
Read more >
How to Enable Inactive Scrolling on Windows 10 - MakeUseOf
How to Enable Inactive Window Scrolling? · Right-click on the Windows Start button and choose Settings. · Go to Devices. · Navigate to...
Read more >
"Scroll Inactive Windows When I Hover Over Them" option not
Go to the desktop and tap on Start menu to look for Settings option and click the same. · Then click Devices category...
Read more >
Scroll inactive windows with keyboard? - Super User
Unfortunately there is no way to scroll an inactive window. Windows can only perform actions on one (and only one) active window.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found