mercredi 7 septembre 2016

jQuery/Javascript sliding toggle menu

I'm trying to make a sidebar that when clicked it (aside li) slides down the section paragraph (section p) with the same class.

var $asideGet = $('aside li').click(function(){
                $(this).each(function(){
                    $(this).attr('class');
            });
        });




        var $sectionGet = $('section p').click(function(){
            $(this).each(function(){
            $(this).attr('class');
        });
    });
    if($asideGet == $sectionGet){
        $asideGet.click(function(){
            $sectionGet.slideToggle();
        });
    };

Aucun commentaire:

Enregistrer un commentaire