jquery do something if toggle open and close

Solutions on MaxInterview for jquery do something if toggle open and close by the best coders in the world

showing results for - "jquery do something if toggle open and close"
Mohamed-Amine
20 Mar 2018
1$('.advance-view').click(function() {
2    $('#advance-control').slideToggle('slow', function() {
3        if ($('#advance-control').is(':hidden'))
4        {
5            $('.advance-view').css("background-color", "#2B509A");
6        }
7        else
8        {
9            $('.advance-view').css("background-color", "#4D6837");
10        }
11    });             
12});
13