Following up on an older post I made (
Have a script.aculo.us effect triggered on page load : how ??), I’ll share a bit of code I now use to replace the script.aculo.us code for my appear effect.
The script.aculo.us stuff looked like this :
<script type="text/javascript"><!-- // --><![CDATA[
/* Observe when page loads and run the "init" function */
Event.observe(window, 'load', init, false);
/* When page is loaded, this function is called */
function init()
{
new Effect.Opacity('submenu', {duration:1.5, from:0.2, to:1.0});
}
// ]]>
</script>
The new one (I’ll refine the code later - I am just a mootools beginner) based used with mootools 1.0 :
<script type="text/javascript">
window.addEvent('load', function() {
var myFx = new Fx.Style('submenu', 'opacity').start(0,1);
});
</script>
I am using window.addEvent because window.onLoad is to be deprecated soon...
Hope it’ll help someone, I had to guess and test before it worked, not many examples for mootools yet (at least examples for laymen like me

)
If someone has corrections or suggestions, I’d be happy to learn more !