• 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)
            })
            }

        }
      }
    })





  • 相关阅读:
    过拟合问题详解
    C++数据结构原理和经典问题求解--绪论
    centos系统 anaconda3(python3)安装pygrib
    pycharm激活教程
    如何查看电脑是几核几线程(网传方法有错误)
    深度学习过程
    VS2010 编译 boost thread库
    windows多线程编程
    matplotlib画条形图
    matplotlib画折线图,并以时间作为横轴
  • 原文地址:https://www.cnblogs.com/BlogRegisterAspx/p/8631575.html
Copyright © 2020-2023  润新知