【问题标题】:Jquery to remove hover from one anchor when i hover another anchor当我悬停另一个锚时,Jquery 从一个锚上删除悬停
【发布时间】:2016-03-11 18:15:21
【问题描述】:

我有 3 个 div,每个 div 中都有一个锚点。

<div class='col-xs-4 sub-heading' id="all"><a href="" >all</a></div>
<div class='col-xs-4 sub-heading' id="articles"><a href="=" > articles</a></div>
<div class='col-xs-4 sub-heading' id="interviews"><a href="" >interviews</a></div>

现在,当页面加载时,锚点应自动设置为“全部”,然后如果我将鼠标悬停在文章或采访上,然后将鼠标悬停在所有应该消失并来到文章或采访(无论鼠标悬停在哪里)和当我出来文章或采访主播应该回到“全部”。

【问题讨论】:

  • 这一切意味着什么?您是在谈论悬停时菜单项的颜色之类的样式吗?
  • 在悬停时我主要是增加字体粗细并在文本下方放置一个边框

标签: jquery html css hover


【解决方案1】:

您可以为此使用 css,这样的东西应该可以工作:

.active {
  color: red;
}
a {
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
<div class='col-xs-4 sub-heading' id="all"><a href="" class="active">all</a>
</div>
<div class='col-xs-4 sub-heading' id="articles"><a href="="> articles</a>
</div>
<div class='col-xs-4 sub-heading' id="interviews"><a href="">interviews</a>
</div>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-19
    • 2013-05-05
    • 1970-01-01
    • 2020-08-27
    相关资源
    最近更新 更多