What is best way to create a cross fade effect?

Posted by Starx on Programmers See other posts from Programmers or by Starx
Published on 2012-10-11T06:30:54Z Indexed on 2012/10/11 9:52 UTC
Read the original article Hit count: 169

Filed under:

While creating an Image Slider, cross-fade is one of most popular effects so far. Various slider on the internet use various techniques to create such effect. Major technique I have found so far are two:

  • Some use a overlay and underlay div and fade in and out each others visibility.
  • While others, create a div of exact size of the slider on the slider-initialization and play with its z-index property and then fade each other consequently.

Disregarding them, what is a proper way or much better way to create a cross fade effect.

P.S: I would love to read answer in form of algorithm.

© Programmers or respective owner

Related posts about web-development