View Full Version : onLoad Javascript problem

10-15-2010, 02:05 PM

I was wondering if it was possible to have an image fade in when a visitor first visits my site (onLoad). I don't want them to have to click on anything to have to play this javascript. I tried a couple different ways.

1. Apply the fade behavior to a hidden apdiv, however the "onLoad" option is not available.

2. Apply the behavior to an image but the hidden option isnt available. Also, is it proper dreamweaver etiquette to apply a behavior to a normal div instead of an apdiv?

Finally, I do not want to make this effect in flash because less people can view a flash file that javascript. I want them to still be able to see the image even if their browser blocks javascript.

I would like the fade in to look like the one at the end of this video (1:58 ) http://www.youtube.com/user/Townliarproductions.

Sorry, this may seem like a stupid question but I am a dreamweaver and javascript newbie.

Thank you for your help! :)

10-15-2010, 02:15 PM
Hi it is i've used it on my site http://www.merseyme.co.uk/testimonials.html

is this what you mean?

I think you have to go to the tag inspector, then behaviours, click on the little + icon then effects/appear/fade

10-15-2010, 02:19 PM
Thanks kearnsy,

Yea, that is the effect I want. Did you apply that to a regular div or an ap div? Also, do you have the image set to hidden before the javascript is played,

10-15-2010, 04:46 PM
To be perfectly honest Mc, i can't remember

Sorry i can't elaborate further, i'm still a newbie myself you see? I'm still learning the ropes and things

I've viewed the source code from my site and i think this is the line of code i've used....
<p align="justify"><img src="images/stan_ollie.jpg (http://www.dreamweaverclub.com/forum/view-source:http://www.merseyme.co.uk/images/stan_ollie.jpg)" width="400" height="300" onload="MM_effectAppearFade(this, 5000, 0, 100, false)" /></p>

Hopefuly one of the pro's will be along to give you the right answer, as i don't want to give you wrong info