On Wednesday 29 July 2009 10:51:52 am DJ Mangus wrote:
> OK, I'll explain this code, hopefully it's what you want.
>
> Observe is a prototype method to set event callbacks.  So,
> document.observe sets an event callback on the document.  It takes two
> arguments, the event name and a function (either name or literal as is
> used in the example).  We are setting a callback for "dom:loaded"
> which is an event prototype adds to the document to indicate that all
> nodes are available to javascript.  Inside that function you can place
> any javascript you want called after the DOM is available.  For
> example, anything that you want to use script.aculo.us effects on you
> can call with like this:  new Effect.Appear("idhere"), for multiple
> nodes you can call them all within that function.  If you want more
> effects on the same node but want them all to run at once, just call
> them all in that function.  Fill it out with all the onload effects
> you want.  If on the other hand you want them to run one at a time on
> the node, then you want to use the afterFinish callback like this:
> new Effect.Appear("idhere", { afterFinish: function(effect) { new
> Effect.Highlight(effect.element) } })
>
> Hopefully this will get you headed in the right direction.

Well I've been at it all day, and can't seem to get anything to work. I'm not 
grasping this at all for some reason. Here is the code i've been trying to get 
to work with your example. I have no idea why it isn't working. the only way I 
can get it to work is to put clickable links in the code. all I'm  looking to 
learn is how to simply fade in the image when the page loads.

well it's going on 2am here, I think I've got to call it a night.

<script type="text/javascript">

document.observe("dom:loaded", 
  
   function ShowEffect(){
       new Effect.Appear(Show, 
       {duration:3});
   }

   </script>
</head>
<body>

<div id="content">
    <img  src="images/logo3.gif" style="display:none" name="show" id="show" 
alt="" />
</div>


-- 
Blessings
David M.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to