对于jq实现带有二级导航的,鼠标移入移出改变css属性样式
1、布局:一级导航用ul li ,二级导航在li 里面可以嵌套div实现
<li class="pull-active"> <a href="">资讯</a> <!-- 二级导航 --> <div class="ul ulH3"> <div class="li"> <a href="">活动</a> </div> <div class="li"> <a href="">通知</a> </div> <div class="li"> <a href="">新闻</a> </div> <div class="li"> <a href="">政策</a> </div> </div> </li>
2、交互:鼠标移入改变背景和字体颜色,移除去掉。
$(".pull-active").mouseover(function () { this.style.background = ‘#f39800‘; this.style.borderRadius = ‘5px‘; this.style.color = "white"; $(this).children(‘.ul‘).fadeIn().css("display",‘block‘); }).mouseleave(function () { $(this).children(‘.ul‘).fadeOut().css("display", ‘none‘); this.style.background = ‘none‘; this.style.color = ‘none‘; });
相关推荐
jiedinghui 2020-10-25
Ladyseven 2020-10-22
zuncle 2020-09-28
xiaohuli 2020-09-02
葉無聞 2020-09-01
nicepainkiller 2020-08-20
AlisaClass 2020-08-09
myloveqiqi 2020-08-09
buttonChan 2020-08-02
drdrsky 2020-07-29
Ladyseven 2020-07-25
nicepainkiller 2020-07-24
AlisaClass 2020-07-19
hellowzm 2020-07-19
background-color: blue;background-color: yellow;<input type="button" value="变蓝" @click="changeColorT
昔人已老 2020-07-19
骆驼的自白 2020-07-18
lanzhusiyu 2020-07-19
hellowzm 2020-07-19
CSSEIKOCS 2020-07-18