I created a very basic sample:
HTML
CSS
#bla {
You could try using CSS opacity
along with setting it to position: absolute
to prevent it from taking up flow on the page. This appears to work properly:
CSS:
#bla {
width:400px;
height:400px;
background-color:green;
opacity: 0;
position: absolute;
}
JS:
setTimeout(function() {
document.getElementById('bla').style.opacity="1";
document.getElementById('bla').style.position="relative";
},2000)
Demo
The key here is that elements with opacity
respond to events (click, hover, etc), while elements with visibility: hidden
and display:none
do not. (source)
Note that opacity
isn't available in IE 8 and below.