I am trying to create an overlay for a div. I am attempting to accomplish this using JQuery. This what the JS looks like:
$('#container').wrapInner('<div />')
.css('opacity', '0.5')
.css('z-index', '2')
.css('background','black')
.attr('id','overlay')
}
};
Update: This is the markup before the JS function is applied:
<body>
<form id="form1" runat="server">
<div id="header">My Header</div>
<div id="container">Container</div>
<div id="menu">
<input type="text" />
<input type="button" class="button" value="Go" onclick="overlay.toggleOverlay();return true" />
</div>
</form>
This seems to manipulate the 'container' div in a way I would not have expected. This is what the markup looks like after the wrapInner method is run:
<div id="overlay" style="z-index: 2; filter: alpha(opacity=50); ZOOM: 1; background: black;">
<div>ContainerDiv</div>
</div>
It is as if the wrapInner method has striped the container div of its attributes. Can someone suggest to me a better way of doing this?
Thanks..