Question
-
Topic
-
How to Fix Manual Scrolling Issue in a Scrolling News Widget?
Hey TechRepublic community! 👋
I’m currently working on a tool for my website that displays the latest news in a scrolling format. The idea is simple: the news scrolls up automatically, and when a user hovers over it, the auto-scroll stops, and manual scrolling is enabled.
Everything works perfectly except one annoying issue — while I can scroll down manually just fine, I can’t scroll back to the top of the news. It’s like the manual scroll refuses to move upward but has no problem going downward.
Here’s a quick breakdown of what I’ve done so far:
HTML/CSS setup: Basic marquee-style news scrolling with overflow: hidden for the container.
JavaScript integration: Added onmouseenter to pause auto-scroll and onmouseleave to resume it. Manual scrolling is controlled via overflow: auto on hover.
Issue debug attempts: Tried tweaking scrollTop in JavaScript and experimented with various CSS properties like overflow-y: scroll, but no luck fixing the upward scroll.
I’m wondering if this might be a JavaScript issue, browser compatibility problem, or something I’ve missed entirely.Has anyone faced a similar issue or have insights on how I could resolve this? If there’s a library or a more robust approach to creating a scrolling news widget, I’m open to suggestions too.
Thanks in advance for your help! 😊