• angularjs 下滑线滑动


    css:
    .detail_row {
    410px;
    height: 34px;
    clear: both;
    border-bottom: 1px solid #eaeeef;
    font-size: 14px;
    position: relative;
    }

    .detail_row1 li{
    float:left ;
    102px;
    text-align: center;
    }
    .detail_row>a{
    display: inline-block;
    /*padding: 0 25px;*/
    color: #3eb7f3;
    -webkit-transition: color .2s;
    transition: color .2s;
    }

    .detail_line1{
    position: absolute;
    left: 0;
    height: 3px;
    0;
    padding: 0;
    background-color: #3eb7f3;
    bottom: 0;
    -webkit-transition: all .3s cubic-bezier(.4,0,.2,1);
    transition: all .3s cubic-bezier(.4,0,.2,1);
    }


    html:

    <ul class="detail_row" line-der>
    <li><a href="#">全部</a></li>
    <li><a href="#">已拒绝</a></li>
    <li><a href="#">已上报</a></li>
    <li><a href="#">待上报</a></li>
    <a href="" class="detail_line1"></a>
    </ul>

    js:(注明需要自己创建controller)
    .directive("lineDer",function(){
      return{
        restrict:'A',
    link:function(scope,$element,$attrs){
           var Li = angular.element(document.getElementsByClassName('detail_row')).find('li');

             var wLi = Li[0].offsetWidth;

           var Wa = angular.element(document.getElementsByClassName('detail_line1'));

             for(var i=0;i<Li.lenght;i++){
            Li[i].addEventLisener('click',functiton(e){
              function(index){

                Wa.css({wLi+'px',left:wLi*index+'px'})

              }(i)
            })
            }

        }
      }
    })





  • 相关阅读:
    linux的别名(alias/unalias)
    asp.net <%%> <%#%><%=%><%@%><%$%>用法与区别
    SQL获取刚插入的记录的自动增长列ID的值
    包和继承
    面对对象编程(封装)
    面对对象编程(上)
    数组(下)
    java数组-如何在一堆数据中使用数组!
    Request和Response学习笔记5
    Request和Response学习笔记4
  • 原文地址:https://www.cnblogs.com/BlogRegisterAspx/p/8631575.html
Copyright © 2020-2023  润新知