FadeIn Problem?

FadeIn Problem?

Yes, a but unlikely but true.

The scenario is this:

- five elements with large images stacked on top of each other with position absolute.
- five thumbnails corresponding to these images.

Click on a thumbnail and fade out the other images and fade in the appropriate image.  Easy eh?  Code looks like this:

      if(this_number != thumbNumber){
        $(this).fadeOut(1000);
      }else{
        $(this).fadeIn(1000);
      };

All that works the way I would expect it to.

So, now because I want to control the initial state for javascript and no-script I use some css to set display:none to four of the large images and display:block for one of the large images.

This breaks the code.  What happens is that the images will fade in but not fade out.  I can watch this happen, or not happen actually, in the console.  

I don't understand how the initial settings of the css effect the behaviour of the jQuery in this case.  Can someone enlighten me???  If you need more of the code then let me know - I was just keeping it simple at the moment.


    • Topic Participants

    • stuff