How to add overlay div to specific element with CSS, jQuery instead of body?

baldeneye

New Member
I was able to add an overlay to the body by writing\[code\]$(function() { var docHeight = $(document).height(); $("body").append("<div id='overlay'></div>"); $("#overlay") .height(docHeight) .css({ 'opacity' : 0.4, 'position': 'absolute', 'top': 0, 'left': 0, 'background-color': 'black', 'width': '100%', 'z-index': 5000 });});\[/code\]How could I select a specific element instead of body? For example, could I add the overlay to with id='baby'?\[code\]<img src="http://stackoverflow.com/questions/14411522/target2_files/BrowserPreview_tmp_07.gif" width="203" height="181" alt="" id='baby'></td>\[/code\]Is this possible?
 
Back
Top