最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Cursor pointer style dosent work on SVG LINE - typescript - Stack Overflow

programmeradmin1浏览0评论

I'm trying to get hover effect on the SVG LINE but it dosen't work. So I'm currently just trying to get a simple cursor pointer style on the line to actually check if anything works at all. But the cursor pointer dosen't work either.The blue is the svg and the red-ish line is the SVG LINE element. So as you can see there are no overlapping.

Does anyone have an idea on why hover effects or cursor pointers dosen't work on SVG LINE?

return (
        <>
            <svg width="100%" height="100%" style={{position:'absolute', top:0, left:0, background:'blue'}}>
                {lines.filter(line => line.page === pageNumber).map((line, idx) => (
                    <line key={idx}
                          x1={line.x1}
                          y1={line.y1}
                          x2={line.x2}
                          y2={line.y2}
                          stroke={hovered === idx ? "rgba(255, 0, 0, 0.6)" : markingColor}
                          strokeWidth={14}
                          style={{transition: 'stroke 0.1s ease', cursor:'pointer', position: 'absolute'}}
                    />
                ))}
            </svg>

        </>
    );
发布评论

评论列表(0)

  1. 暂无评论