I’m a javascript newbie so please forgive me if this question is really basic. I’m having one problem with what I’m trying do to.
I have an image on a page.
I want to put a black box on top of the image (using CSS presumably) i.e. to conceal the image.
Then, using JavaScript, when the mouse moves over the black CSS box, the black box fades out revealing the image.
I know how to do the fade out using JavaScript, but I’m having trouble getting a CSS box on top of the image…
Thanks if you can help by telling me how to do this.
Note, in my efforts so far, I created a box using CSS and then added an image to the page, but the image just removed the CSS box.
I decided to add the black cover with JavaScript. This way, a JavaScript disabled user will still get to see your image.
HTML
CSS
jQuery
jsFiddle.