使用刻字更改悬停/鼠标的徽标字母.在Mouseleave上,将其重新回到原始单词/字母



我想获得一个徽标名称" thrive"。在悬停/鼠标上,将字母更改为" T"。当MouseLeave更改为"繁荣"时。

如果有人可以提供帮助会很棒。这可以使用jQuery和CSS来完成。谢谢。

我尝试使用jQuery使用徽标图像.fadeToggle((实现,并且它正在切换两个徽标图像。图像看起来不太好,这就是为什么我需要刻字方面的帮助,而我却不是什么?

与.fadetoggle((一起使用的代码。

<div class="logos">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php theme_prefix_the_custom_logo()?></a>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img class="hide" src="https://www.example.com/foldername/t-logo.png"></a>
</div>
jQuery(document).ready(function () {
    jQuery('.logos').hover(function(){
        jQuery(this).find("img:last-child").fadeToggle(500);
    });
});

鼠标悬停/输入更改徽标单词/字母仅给单个字母,而在鼠标上,请留下字母再次更改为完整单词

<div class="logos">
   <a href="http://www.google.com"><span>T</span><span class="hideIt">hrive</span></a>
</div>
$(".logos").on("mouseover",function(){
    $(this).find(".hideIt").hide()
});
$(".logos").on("mouseout",function(){
    $(this).find(".hideIt").show()
})

小提琴

我会让您弄清楚如何使字母看起来很漂亮

尝试以下:

<!DOCTYPE html>
<html>
<head>
<style>
#logo{
margin:0px auto;
}
.text::before { 
content: "Thrive";
}
#logo:hover .text::before{
content: "T";
}
</style>
</head>
<body>
<span id="logo"><p class="text"></p></span>
</body>
</html>

JSFIDDLE中的代码:更改标题字母

最新更新