This version is old school.
Please find jQuery plugins on npm.
jQuery Element Background Dimming
by Andy Wermke
This lightweight plugin allows you to dim (darken) all the website but one or more user-selected elements. A frequently used eye candy for every web application.