Open menu item

0

I have a side menu that when the user click changes the color of a selected item in the menu atravens of a javascript code, however when an update happens on the screen the class is removed. Would anyone have any tips on how to leave the selected color after screen refresh?

I wanted you to have the same behavior as sbadmim link

   var selector2 = '.menu-section-list li';

    $(selector2).on('click', function () {
        console.log("s");
         $(selector2).removeClass('active');
        $(this).addClass('active');
    });

    
asked by anonymous 25.03.2017 / 00:32

1 answer

0

Note that in%% of each menu option loads a different page that is displayed in sbadmin , so it is easy to check which screen state is only checking url , which can be obtained with url .

That said it's worth saying that sbadmin uses metisMenu.js and you can study how this is implemented or simply use it too.

    
25.03.2017 / 23:08