I have a div and after I click a button, I would like the div to appear (which I can do), but I would like the whole background to become darker too (this is inline with overlays).
I’ve tried using opacity – I change the opacity of the whole html with jQuery, i.e. $('html').css('opacity','-0.5'); and change back the opacity of the div to normal, but for some reason, the opacity of the div stays the same (0.5).
I don’t quite like the opacity since actually it doesn’t make the background darker (rather lighter).
HTML–
CSS–
JS–
Then just add your youtube video embed code to the
overlaydiv and style it appropriately to put it where you want on the page.Here is a demo: http://jsfiddle.net/EtHbf/1/