鼠标移到目标上();不工作

onmouseover(); Not working?

本文关键字:工作 目标 鼠标      更新时间:2023-09-26

所以我在这里做了一个投资组合网站,出于某种原因,每当我试图将onmouseover事件附加到任何图标上时,什么都没有发生,我试图让我的名字的文本消失在你悬停的图标的名称中,当你把鼠标移开时,有没有办法做到这一点?我已经尝试了大约十种"解决方案"

谢谢

<td onclick="move('url');" onmouseover="alert();" class="tile" id="portfolio"></td>

我注意到你的网站正在加载jQuery所以我要给你一个使用jQuery的答案尽管你的标签上没有列出

$("#about").mouseover(function(){ //When the mouse enters
    $("span.text").fadeOut("slow",function(){
        //After your name has fadedOut switch the text and fadeIn
        $("span.text").html("About");
        $("span.text").fadeIn("slow");
    });
}).mouseout(function(){ //When the mouse leaves
    $("span.text").fadeOut("slow",function(){
        //After "about" has fadedOut switch with your name and fadeIn
        $("span.text").html("Matthew Foulks");
        $("span.text").fadeIn("slow");
    });
});

希望这有帮助。