css样式一开始不显示,点击显示隐藏

 

先隐藏在字段里写style="display:none"

点击显示隐藏

$(".a").click(function(){
if($("#aa").css("display")=="none"){
$("#aa").show();
}else{
$("#aa").hide();
}
});

替换属性

先设置好class名字

 $("#btn2").attr("class","c_btn_li");

 

.act{
background: rgba(11,93,181,1);
border: 1px solid #0b5db5;
color: #00fffd;
line-height:28px;
text-align:center;
width: 68px;
height: 28px;
border-radius: 2px;
float: left;
display: inline-block;
margin: 5px;
}
.c_btn_li{
line-height:28px;
text-align:center;
width: 68px;
height: 28px;
border-radius: 2px;
background: rgba(11,93,181,0.3);
border: 1px solid #0b5db5;
color: #1a8589;
float: left;
display: inline-block;
margin: 5px;
}

posted @ 2018-07-07 12:57  我吗?  阅读(520)  评论(0编辑  收藏  举报