PDA

View Full Version : Div onload



cheechm
08-30-2007, 05:23 PM
Hello,
I need help using scriptaculous.
I have a div which looks like this:

<div class="text" id="about" onclick="Effect.Appear(this)">
I was wondering how I could make it so that on body load (ie
<body onload="">) I could make the div fade.
Thanks

boogyman
08-30-2007, 05:51 PM
what do you mean fade? are you talking about the background color? or the visibility? or something else?

cheechm
08-30-2007, 06:19 PM
Sorry, fade is a Scriptaculous effect. I got this but it doesn't work:


<script type="text/javascript">
Event.observe('window', 'load', function() {
Effect.Appear('about');

});
</script>
<body onload="new Effect.Appear('about',{});">

boogyman
08-30-2007, 07:14 PM
yes i understand that its a fade... but im asking what it is fading...
you can fade the background to different colors
you can fade the visibility either from nothing to visible or visaversa
you can fade the color of the text...

so im asking what you are trying to fade

cheechm
08-30-2007, 07:39 PM
I am fading a DIV from 0 opactity to 100% opacity.

boogyman
08-30-2007, 08:11 PM
http://www.brandspankingnew.net/archive/2006/09/javascript_css_crossfader.html
or
http://www.soxiam.com/Code/JavascriptFadeAnything