how to toggle in between 2 classes in jquery?

前端 未结 2 523
情歌与酒
情歌与酒 2020-12-22 04:28

i have an issue doing toggleClass it doesn\'t seem to work properly. the image should change in between show and hide. It does change

2条回答
  •  轮回少年
    2020-12-22 04:54

    There is a toggle function that does it for you out of the box:

    $(".show_menu").toggle();
    

    toggle docs:

    Description: Display or hide the matched elements.

提交回复
热议问题