Does the icon disappear when toggle?

! [clipboard.
clipboard.png
ejRm)

I want to switch the icon direction when clicking the icon through jquery"s toggle, and expand or shrink the panel at the same time, but through the following code, when the icon changes automatically, it disappears. What"s going on?

$(".glyphicon-chevron-up"). Toggle (

)
        function () {
            $(".hideShow").css("display","table-row");
            // $(this).removeClass("glyphicon-chevron-up");
            // $(this).addClass("glyphicon-chevron-down");
        },function(){
            $(".hideShow").css("display","none");
            // $(this).removeClass("glyphicon-chevron-down");
            // $(this).addClass("glyphicon-chevron-up");

        }
    )

Mar.30,2021

after testing, multiple function switching is not supported for toggle version 1.8 or above.

$('.glyphicon-chevron-up').click(function() {
     $(".hideShow").toggleClass('show-class')
}

change toggleClass to deal with it

Menu