So fadeIn only works when it's element is displayed none and doesn't
check at all if it's element has a changed opacity?

Doesn't it make more sense if fadeIn checks for it's current opacity
and fades from there;
 jQuery(this).fadeTo(2000, 0.25).fadeIn(2000);
I say that because if I use fadeOut instead of fadeIn, it does check
for it's current opacity and fades from there;
 jQuery(this).fadeTo(2000, 0.25).fadeOut(2000);

Anyways I'm relative new to jQuery (not to js) and that's how I
thought it worked. Maybe write a comment in the documentation that
fadeIn only checks for display:none.

Thnx for your comment.

gr J

On 18 feb, 15:55, John Resig <jere...@gmail.com> wrote:
> fadeIn won't have an effect if it's already visible (it'll fire
> instantly). fadeIn takes a hidden (display: none) element and changes
> its opacity to 1 over the time frame.
>
> If you're looking to fade to 0.25 over 2 seconds, then fade to 1 over
> 2 seconds I'd do:
>   jQuery(this).fadeTo(0.25, 2000).fadeTo(1, 2000)
>
> --John
>
> On Wed, Feb 18, 2009 at 9:33 AM, jerone <jeron...@gmail.com> wrote:
>
> > I'm not that familiar with jQuery yet, so I wanted to pass this trough
> > you guys first.
> > Shouldn't this work with both a interval of 2 seconds:
>
> > jQuery("p").click(function() { jQuery(this).fadeTo(2000, 0.25, function
> > () { alert("2 seconds later => PASSED"); jQuery(this).fadeIn(2000,
> > function() { alert("should be 2 seconds later after last alert (4 secs
> > total)! => FAILED") }) }) });
>
> > gr J
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to