I'm trying to grey out the background when a user clicks on the submit button and show the loading icon over the greyed background.
below is the icon im trying to show, however I'm not able to show the animation, the icon just stays still.
Here is my html:
<div class=container></div>
<div id=loading-img style= z-index: 20;display:none;></div>
<button id=button>Submit</button>
JS:
$(#button).click(function() {
$(#container).css(opacity,0.5);
$(#loading-img).css({display: block});
}
I'm not sure how exactly to use the css for making the icon animate over the grey background. Any ideas please??
EDIT::::
Fiddle: http://jsfiddle.net/hnk6bLbt/1/
Thanks!