You will need to use javascript for this, and jQuery will simplify it. First, place your #dimmer div directly inside the body your html - if it is deeper, you only risk reducing the portion of your page if any of its parent elements have absolute, fixed or relative positioning. Secondly, add a click event on your button that displays the dimmer. This is easy with a little jQuery (which I haven't tested yet):
$('#dim_button').click(function() { $('#dimmer').show(); });
(You will need to make sure that the button has loaded by the time this code is run, otherwise nothing will be done. The best way to do this is to wrap it inside $('document').ready(function{}); )
Please note that in some older browsers, the dimmer diver, sitting on the top of the page, will not allow the user to click anything in it, which will potentially make your page unusable. If you darken a page to place a popup on top of this, make sure that closing the popup also removes the dimmer. Also note that in most (all?) New browsers, users will be able to click through a dimmer and interact with the page below, which may not be what you want.
source share