jQuery UI switchClass() method is not working properly

后端 未结 7 2173
野的像风
野的像风 2020-12-11 15:43

jQuery UI switchClass() method doesn\'t switch class, rather it performs some undesired animations and the class remains the same as the original one when I use

7条回答
  •  遥遥无期
    2020-12-11 16:30

    I have encountered this problem before and wasted many hours trying to figure out what was going wrong.

    I still don't know why switchClass sometimes doesn't work, but I do have a workaround:

    Replace

    switchClass('circle','square');
    

    with

    addClass('square').removeClass('circle');
    

    Hope that helps.

提交回复
热议问题