Slide down and slide up div on click

后端 未结 3 822
情话喂你
情话喂你 2020-12-20 22:19

I am using the following code to open and close a div ( slide up/down ) using js

I have the slide down event attached to a button and the slide up event sttached to

3条回答
  •  Happy的楠姐
    2020-12-20 23:06

    You can just use slideToggle() in the click function:

    $('.grabPromo').click(function(e){
        $('.slideDown').slideToggle();
    });
    

    Here's a demo.

提交回复
热议问题