默认角度
.rotate{
transform-origin:center center;
transform: rotate(180deg);
-webkit-transform:rotate(180deg);
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-o-transform: rotate(180deg);
transition: transform 0.2s;
-moz-transition: -moz-transform 0.2s;
-moz-transition: -moz-transform 0.2s;
-o-transition: -o-transform 0.2s;
-ms-transition: -ms-transform 0.2s;
}
要旋转角度
.rotate1{
transform-origin:center center;
transform: rotate(0deg);
-webkit-transform: rotate(0deg);
-moz-transform: rotate(deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transition: transform 0.2s;
-moz-transition: -moz-transform 0.2s;
-moz-transition: -moz-transform 0.2s;
-o-transition: -o-transform 0.2s;
-ms-transition: -ms-transform 0.2s;
}
JS
var mx_sel = $(".mx_sel");
mx_sel.click(function(){
var ts = $(this);
// 如果有rotate,则删除rotate,添加rotate1
if(ts.find(".jiantou").hasClass("rotate")){
ts.find(".jiantou").removeClass("rotate");
ts.find(".jiantou").addClass("rotate1");
}else{
ts.find(".jiantou").removeClass("rotate1");
ts.find(".jiantou").addClass("rotate");
}
});