打开/关闭搜索
搜索
打开/关闭菜单
2
1
189
潮语辞书
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
上传文件
打开/关闭外观设置菜单
notifications
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
创建账号
登录
查看“︁茄”︁的源代码
来自潮语辞书
分享此页面
查看
阅读
查看源代码
查看历史
associated-pages
页面
讨论
更多操作
←
茄
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
<html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>交互 SVG 示例</title> <style> #tooltip { position: absolute; background: #fff; border: 1px solid #aaa; padding: 4px 8px; border-radius: 4px; display: none; pointer-events: none; font-size: 14px; } svg circle { cursor: pointer; transition: fill 0.2s; } svg circle:hover { fill: orange; } </style> </head> <body> <svg width="400" height="300" style="border:1px solid #ccc;"> <!-- 圆形标记 --> <circle cx="100" cy="150" r="30" fill="blue" data-info="这里是圆形 🐱"></circle> <circle cx="250" cy="100" r="40" fill="green" data-info="这里是大圆 🌸"></circle> <circle cx="300" cy="200" r="25" fill="red" data-info="这里是小圆 🌟"></circle> </svg> <div id="tooltip"></div> <script> const tooltip = document.getElementById('tooltip'); const circles = document.querySelectorAll('svg circle'); circles.forEach(circle => { circle.addEventListener('mousemove', e => { tooltip.style.left = (e.pageX + 10) + 'px'; tooltip.style.top = (e.pageY + 10) + 'px'; tooltip.innerHTML = circle.getAttribute('data-info'); tooltip.style.display = 'block'; }); circle.addEventListener('mouseleave', () => { tooltip.style.display = 'none'; }); }); </script> </body> </html>
返回
茄
。
查看“︁茄”︁的源代码
来自潮语辞书