Bogdan Verbenets
Bogdan Verbenets

Reputation: 26952

jQuery fadeOut doesn't work

$(div1.children().get(0)).fadeTo(0, 0.1);

Doesn't work :( But if I specify fateOut instead of fadeTo, then it works! So how do I make it work? The HTML structure is like this:

<div id="div1">
<a><img/></a>
<a><img/></a>
<a><img/></a>
</div>

I've tested in IE9 and in Chrome.

Upvotes: 0

Views: 1898

Answers (4)

Bogdan Verbenets
Bogdan Verbenets

Reputation: 26952

This one works: $($(div1.children().get(CurrentPosition)).children().get(0)).fadeTo(0, 0.5); I think the reason is that fading must apply to the image, not to it's container. Although it does seem strange to me.

Upvotes: 0

Andbdrew
Andbdrew

Reputation: 11895

fadeTo(100, 0) will work better =D

the syntax is:

.fadeTo( duration, opacity, [ callback ] )

Andy

Upvotes: 1

Naftali
Naftali

Reputation: 146360

seems to be working for me :-) check it out http://jsfiddle.net/maniator/SnzJM/

Upvotes: 0

user667618
user667618

Reputation:

A duration of 0 disables the effect. Try a duration of 'fast' or 100 (fast is 200ms, slow is 600 ms).

Upvotes: 0

Related Questions