removeClass() if it exists

后端 未结 6 1048
时光说笑
时光说笑 2020-12-29 20:01

This function adds a rotated class to my button when I click it. The button has an arrow on it which points in the direction the panel has slid.

How co

6条回答
  •  执笔经年
    2020-12-29 20:57

    if($('#btnDiv').hasClass('rotated')){
       $('#btnDiv').removeClass('rotated')
    }else{
       $('#btnDiv').addClass('rotated')
    }
    

提交回复
热议问题