The MOOdalBox script is a great addition to the mootools library. The interface is pretty slick. And easy to style with just CSS. Răzvan Brateş did a great job here. And every now and then i have to implement one of those MOOdalBoxes in a web application. No problem here.
This kept giving me the following error:
this.overlay is undefined
Looking through the MOOdalBox source. I noticed the this.overlay property was set inside the init() method. So let’s try that before we call the open() method.
This actually worked. I was pretty happy with the result. untill i opened IE 7 to test the same page. Nothing happened. No error’s and no MOOdalBox. Let’s try something else. Whenever i need to load something on page load in IE i use the window.onload method.
Now the overlay was loaded. But still no MOOdalBox on top of it. I figured it had something to do with the DOM not being fully loaded. But i couldn’t really think of a solution. So of to Google. After a bit of browsing i found somebody with the same problem. And a reply from the original author of MOOdalBox. Add a domready event to make it work.
This did it. And my only goal was to make it function properly inside of IE 7. but this also fixes the same problem for IE 6. So a big thanks to Răzvan for creating MOOdalBox and for supplying the fix.