I too am looking to do something similar to this. I think the issue
you are running into is your innerHTML and Fade In should occur after
the Fade Out is finished, however there is not an onComplete option
for Effect.Fade.
It would need to look something like this:
new Effect.Fade('caption', {to:0.0, duration: .3, onComplete:
function(){
$('caption').innerHTML = caption;
new Effect.Fade('caption', {to:1.0, duration: .3 });
}
});
Unfortunately, I've had no luck with an onComplete with Effect.Appear,
Effect.Fade, or Effect.Opacity. I wish i could contribute to
Script.aculo.us but I wouldn't know where to begin to add this
feature.
On Jun 7, 5:00 pm, Rich <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I'm now having an odd problem with Effect.Fadenot working based on
> theinnerHTMLof a div.
>
> Take the following for example...
>
> <div id="blah">
> Nothing here yet.
> </div>
>
> If I then update "blah", hide it and thenfadeit in, like so:
>
> <script type="text/javascript">
> document.getElementById("blah").innerHTML= '<div id="box">Box content
> goes here</div>';
> Element.hide('box');
> new Effect.Appear('box', {duration: 3});
> </script>
>
> That works beautifully.
>
> However, if I attempt tofadeout "box" after approximately 20
> seconds, nothing happens at all.....
>
> I'm attempting tofadeout using:
>
> new Effect.Fade('box');
>
> If I reload the page, which PHP produces, which already contains the
> div's in place -fadeworks perfectly. Any ideas? The only
> difference I can see between the content of the current div and the
> new div, is the opacity level. Should this make a difference?
>
> TIA,
> Rich.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---