You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

鼠标触碰marquee内图片时停止滚动,求相关搜索关键词

How to Pause a Marquee Scrolling Image on Hover for Your GitHub Pages Site

Hey Andy! I get that you're trying to make that scrolling image in your GitHub Pages site stop when someone hovers over it, and couldn't find the right search terms to figure this out. Let's fix that quickly!

The good news is that the <marquee> tag actually has built-in methods to control its scrolling behavior—no fancy external libraries needed. You just need to add two event attributes to your marquee element to trigger stopping and starting the scroll when the mouse interacts with it.

Here's the modified code you can use:

<marquee behavior="scroll" direction="left" onmouseover="this.stop()" onmouseout="this.start()">
  <img src="https://therealandy0074.github.io/therealandy0074/your-image-path.jpg" alt="Scrolling footer image">
</marquee>

Breakdown of what this does:

  • onmouseover="this.stop()": When the mouse moves over the marquee (and the image inside it), this calls the stop() method on the marquee element, pausing the scroll immediately.
  • onmouseout="this.start()": When the mouse moves away from the marquee, the start() method kicks in, resuming the scrolling as normal.

Pro tip for future searches:

If you ever need to look up similar marquee-related tweaks, try search terms like "marquee tag stop on mouse hover" or "HTML marquee pause on hover"—these should lead you to relevant solutions right away.

内容的提问来源于stack exchange,提问作者Andy Eko Saputra

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 07:09:32