常见样式知识点

es6: <script type="text/ecmascript-6">

stylus: <style scoped lang="stylus" rel="stylesheet/stylus" >


  var $ss=$("#t-tbody").find("input[disabled][checked]").length;   //[disabled]且checked时的状态


//单选or复选框自定义样式案例
.activity-title-L input[type="checkbox"]{
   -moz-appearance:none; /* Firefox */
   -webkit-appearance:none; /* Safari 和 Chrome */
   appearance:none;
   display: inline-block;
   height: 16px;
   width: 16px;
   background: #fff url(../images/checkbox-blue.png) no-repeat;
   margin-top: 6px;
   margin-right: 4px;
   background-position: 0px -16px;
}
.activity-title-L input[type="checkbox"]:checked{background-position: 0px 0px;}


//菱形css实现
   elem:after{
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    background: #fff;
    top: 25px;
    left: 40px;
    opacity: .7;
    -webkit-transform: rotate(50deg);
    transform: rotate(50deg);
}


 showRemove :false,//显示移除按钮
 showCaption:false,//是否显示标题
            

//hover卡片效果
.content .daiban-tem li{
    display: inline-block;
    padding-left:40px;
    width:230px;
    height:95px;
    line-height:30px;
    background-color: #fff;
    padding-top:35px;
    color:#999;
    -moz-transition: all 0.3s linear 0s;
    -webkit-transition: all 0.3s linear 0s;
    -o-transition: all 0.3s linear 0s;
    transition: all 0.3s linear 0s;
}
.content .daiban-tem li:hover{
    -moz-transform: translate(0,-5px);
    -webkit-transform: translate(0,-5px);
    -o-transform: translate(0,-5px);
    transform: translate(0,-5px);
    -webkit-box-shadow: 0 0 7px rgba(0,0,0,0.3);
    box-shadow: 0 0 7px rgba(0,0,0,0.3);
}
//按钮水纹
/*按钮水纹*/
.btn-blue1,.btn-blue2{
    position: relative;
    overflow: hidden;
    -webkit-transform: translate3d(0, 0, 0);
    -moz-transform: translate3d(0, 0, 0);
    -ms-transform: translate3d(0, 0, 0);
    -o-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

.btn-blue1:after,.btn-blue2:after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #000 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    -webkit-transform: scale(10,10);
    -moz-transform: scale(10,10);
    -ms-transform: scale(10,10);
    -o-transform: scale(10,10);
    transform: scale(10,10);
    opacity: 0;
    filter:Alpha(opacity=0);/*IE8以下浏览器*/
    -webkit-transition: transform .5s, opacity 1s;
    -moz-transition: transform .5s, opacity 1s;
    -o-transition: transform .5s, opacity 1s;
    transition: transform .5s, opacity 1s;
}

.btn-blue1:active:after,.btn-blue2:active:after {
    opacity: .2;
    filter:Alpha(opacity=20);/*IE8以下浏览器*/
    -webkit-transform: scale(0,0);
    -moz-transform: scale(0,0);
    -ms-transform: scale(0,0);
    -o-transform: scale(0,0);
    -webkit-transition: 0s;
    -moz-transition: 0s;
    -o-transition: 0s;
    transition: 0s;
}
/*end*/
//月亮效果

.moon{

width:100px;

height:100px;

border-right:20px solid #F60;

border-radius:50%;
}

 


像checkbox,radio和select这样的元素,选中属性对应“checked”和“selected”,这些也属于固有属性,因此需要使用prop方法去操作才能获得正确的结果。

$("#chk1").prop("checked") == false
$("#chk2").prop("checked") == true
如果上面使用attr方法,则会出现:

$("#chk1").attr("checked") == undefined
$("#chk2").attr("checked") == "checked"

  

posted @ 2018-01-05 10:56  黎明之光123  阅读(149)  评论(0编辑  收藏  举报