gpt4 book ai didi

jquery - 如何在悬停时更改箭头的颜色?

转载 作者:太空宇宙 更新时间:2023-11-03 23:00:07 24 4
gpt4 key购买 nike

我不确定我是否正确编写了 HTML。因此,我的脚本可能无法运行。我使用段落在箭头和上面的文本(未显示)之间创建空间。

    <div class="littlebg">
<div class="text">
<hr>
Renowned Japanese author Haruki Murakami said he owns over <a href="http://www.nytimes.com/2011/10/23/magazine/the-fierce-imagination-of-haruki-murakami.html?pagewanted=5&ref=baseball&_r=0">10,000 records</a>. He often references music in his stories, particularly the genres classical, jazz and American pop. His first job was at a record store, and he once ran a jazz bar, called the Peter Cat, in Tokyo with his wife.
<a href="#begin2">
<p><div class="arrow"></div></p>
<a href="#begin2">
<p>
<div class="arrow"></div>
</p>
</a>

<script>
$("div.arrow").hover(function() {
$('this').css("border", '#4da6ff');
});
</script>

</div>

最佳答案

引用是 $(this)this,而不是 $('this')

此外,您只考虑mouseenter,您应该在鼠标离开元素时编写第二个回调并恢复之前的值。

信息:https://api.jquery.com/hover/

关于jquery - 如何在悬停时更改箭头的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36871832/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com