0

I tried changing the background color of the left navigation list items when an item is clicked.When its clicked,it shows the effect but when the content in the page layout loads,the color is changed to some other color which I believe is happening because of the default javascript.Following is the code

$( function() {
  $('.static a').click(function(){
      $(this).css("background","black");
  });
});

Note: class name of the left nav list items is 'static' and 'a' has the navigation link of the list item,when an item is clicked its class name changes to 'static selected'. How to make the javascript changes stay still once an item is clicked.

2
  • Are you trying to update color background in Quick navigation(Left-Side), right?
    – Pradip R.
    Commented Dec 30, 2014 at 5:28
  • not the quick navigation bg color,but the bg color of selected list item of the quick navigation.
    – noah_dvlpr
    Commented Dec 30, 2014 at 5:49

1 Answer 1

0

I found the fix,

.ms-core-listMenu-selected:visited{ background-color:black; }

This will set the selected list item of the quick nav bar to the bg color that we want it to have.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.