On click slidetoggle div but hide others first - jQuery

后端 未结 5 1832
太阳男子
太阳男子 2021-02-06 13:06

I have a page that when a user clicks a title, the following div toggles display.

I want to somehow say if any other divs are display:block then set them to display non

5条回答
  •  盖世英雄少女心
    2021-02-06 13:38

    $('.office-title').click(function(){
         $(this).next('div').slideToggle();
         $(this).parent(".office-row").siblings().hide(); // this should help
         return false;
    });
    

提交回复
热议问题