zoukankan      html  css  js  c++  java
  • js样式,默认显示第一个

    1、
    $('.z_scly_li li').mouseover(function(){
    $(this).find('a').addClass('z_scly_li_on').parent().siblings().find('a').removeClass('z_scly_li_on');
    });

    样式:
    .z_scly_li_on{
    color:#1565c0!important;
    text-decoration:underline!important;
    }
    HTML:
    <ul class="z_scly_li">
    <li><a class="z_scly_li_on" href="">心理箱庭疗法</a></li>
    <li><a href="">心理咨询</a></li>
    <li><a href="">心理测量</a></li>
    <li><a href="">个人成长</a></li>
    <li><a href="">案例督导</a></li>
    <li><a class="z_connect f16" href="">联系咨询</a></li>
    </ul>
    2、
    $(".qtzjtj_con").find("li").hover(function(){
    $(this).addClass("on").siblings().removeClass("on");
    });
    $(".qtzjtj_con").find("li").mouseover(function(){
    $(this).find('img').addClass("onn");
    }).mouseout(function(){
    $(this).find('img').parent().siblings().find('img').removeClass("onn");
    });

    HTML:
    <ul class="qtzjtj_con text-center">
    <li class="on"><img class="img-circle onn" src="static/images/图层 3.png" style="168px;height:168px;border:1px solid #e1e1e1;"/>
    <p style="margin-top:130px;"> <h4 class="f21 f21_h4">蔡忠准</h4><span class="f18">国际权威催眠大师</span></p></li>
    <li><img class="img-circle" src="static/images/图层 3.png" style="168px;height:168px;border:1px solid #e1e1e1;"/>
    <p style="margin-top:130px;"><h4 class="f21 f21_h4">蔡忠准</h4><span class="f18">国际权威催眠大师</span></p></li>
    <li><img class="img-circle" src="static/images/图层 3.png" style="168px;height:168px;border:1px solid #e1e1e1;"/>
    <p style="margin-top:130px;"><h4 class="f21 f21_h4">蔡忠准</h4><span class="f18">国际权威催眠大师</span></p></li>
    <li><img class="img-circle" src="static/images/图层 3.png" style="168px;height:168px;border:1px solid #e1e1e1;"/>
    <p style="margin-top:130px;"><h4 class="f21 f21_h4">蔡忠准</h4><span class="f18">国际权威催眠大师</span></p></li>
    </ul>

    样式:
    .on{
    border:1px solid #1e88e5!important;
    }
    .onn{
    border:1px solid #1e88e5!important;
    }

    3、
    $('.z_hyzc1>div').mouseover(function(){
    $(this).addClass('z_on').siblings().removeClass('z_on'); //找同级的
    $(this).addClass('z_on').parent().siblings().find('div').removeClass('z_on'); //找父级里的子级
    });
     


  • 相关阅读:
    Golang-字符串常用的系统函数
    35.HTML--网页自动跳转 5种方法
    34.js----JS 开发者必须知道的十个 ES6 新特性
    33. 禁止鼠标右键保存图片、禁止拖动图片
    32.js 判断当前页面是否被浏览
    31.JS实现控制HTML5背景音乐播放暂停
    30.get和post的区别
    29.html5 移动端开发总结
    28.json数组,select选择,input输出对应数据
    27.给input边框和背景颜色设置全透明
  • 原文地址:https://www.cnblogs.com/wolflower/p/6857067.html
Copyright © 2011-2022 走看看