gpt4 book ai didi

jquery - 如何让 li 标签单独点亮

转载 作者:行者123 更新时间:2023-12-01 07:19:44 24 4
gpt4 key购买 nike

如何获取 li鼠标悬停在所有 li 上时,标签会单独亮起标签立即亮起

 $(document).ready(function(){
$("li").mouseover(function(){
$("li").css("background-color","yellow");
});
$("li").mouseout(function(){
$("li").css("background-color","lightgray");
});
});

HTML:

 <ul class="menu">
<li>Bookmarks</li>
<li>Something</li>
<li>BUMPER STICKERS</li>
<li>CARBONLESS FORMS</li>
<li>CD JACKETS</li>
<li>DIE CUT/CUSTOM STICKERS</li>
<li>DOOR HANGERS</li>
<li>ENVELOPES</li>
<li>FOLDERS</li>
<li>LETTERHEADS</li>
<li>RECTANGULAR STICKERS</li>
<li>ROUND STICKERS</li>
<li>STATIC CLING </li>
<li>TABLE TENTS</li>
<li>VINYL BANNERS</li>
<li>WINDOW STICKERS</li>

</ul>

最佳答案

演示:http://jsfiddle.net/whZYD/

 $(document).ready(function(){
$("li").mouseover(function(){
$(this).css("background-color","yellow");
});
$("li").mouseout(function(){
$(this).css("background-color","lightgray");
});
});

关于jquery - 如何让 li 标签单独点亮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15151501/

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