片段

2018-11-02  本文已影响0人  隔壁老王z
//给图片添加:
       img{
            height: 100%;
            max-width: 100%;
            transition: all .3s ease;
            /* -webkit-filter: grayscale(100%); */
            filter: grayscale(100%);
            opacity: .66;
        }
        img:hover{
            filter: grayscale(0%);
            opacity: 1;
        }
.el-input-number__increase:hover:not(.is-disabled)~.el-input .el-input__inner:not(.is-disabled){  
        background-color: #fff;
}
<span @mouseover="pic = star1_img" @mouseout="pic = star_img">
        <img :src="pic" alt="">
</span>
data () {
      return {
      pic: require('../../static/img/star1.png'),
      star_img: require('../../static/img/star1.png'),
      star1_img:require('../../static/img/star.png')
      }
  }
var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;

因为当0undefined进行运算,默认返回的是后面一个,window.pageYOffset放在中间不会报错。

const { active, count, swipes, deltaX, width } = this;
//再也不用重复使用this.active、this.count等取值,直接用active、count代替
var prevLink = document.referrer;  
if($.trim(prevLink)==""){  
    location.href = 'www.example.com/index.html';   //回到首页
}else{  
    if(prevLink.indexOf('www.example.com')==-1){    //来自其它站点  
        location.href = 'www.example.com/index.html';  
    }  
    if(prevLink.indexOf('register.html')!=-1){      //来自注册页面  
        location.href = 'www.example.com/index.html';  
    }  
    location.href = prevLink;  //其他情况
}  
//包裹文字的盒子设置css:
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
<div class="box first"></div>
<div class="box second"></div>
<div class="box third"></div>
.box {
  margin: 80px 30px;
  width: 200px;
  height: 200px;
  position: relative;
  background: #fff;
  float: left;
}
.box:before {
      content: '';
      z-index: -1;
      position: absolute;
      width: 220px;
      height: 220px;
      top: -10px;
      left: -10px;
}

.first:before {
  background-image: linear-gradient(90deg, yellow, gold);
}
.second:before {
  background-image: linear-gradient(0deg, orange, red);
}
.third:before {
        background-image: repeating-linear-gradient(-45deg,#cc2a2d,#cc2a2d 30px,#f2f2f2 30px,#f2f2f2 40px,#0e71bb 40px,#0e71bb 70px,#f2f2f2 70px,#f2f2f2 80px);
}
image.png
上一篇下一篇

猜你喜欢

热点阅读