初级作业求助 关于svg里插入javascript

2025-04-30 06:40:55
推荐回答(2个)
回答1:


window.onload = function(){
var t = document.getElementById("1");
t.onmouseover = function(){
t.style.fill = 'green';
}
t.onmouseout = function(){
t.style.fill = 'yellow';
}
}

 其余元素都差不多,只是多写几遍,添加监听罢了

回答2:

帮你顶,看通过坐标判断能否实现