How to do fade-in and fade-out with JavaScript and CSS

Here is a more efficient way of fading out an element: function fade(element) { var op = 1; // initial opacity var timer = setInterval(function () { if (op <= 0.1){ clearInterval(timer); element.style.display = ‘none’; } element.style.opacity = op; element.style.filter=”alpha(opacity=” + op * 100 + “)”; op -= op * 0.1; }, 50); } you … Read more

How to make div occupy remaining height?

Use absolute positioning: #div1{ width: 100%; height: 50px; background-color:red;/*Development Only*/ } #div2{ width: 100%; position: absolute; top: 50px; bottom: 0; background-color:blue;/*Development Only*/ } <div id=”div1″></div> <div id=”div2″></div>

How can I programmatically disable IE compatibility mode?

If you want the “old” rendering, and no button to show up on the toolbar so that users can switch modes you can use this: <head> <!– Mimic Internet Explorer 7 –> <meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ > <title>My Web Page</title> </head> other options (old and new) include:IE=5, IE=7, IE=8, or IE=edge (edge equals highest mode available)