Posted By

nerdfiles on 08/14/09


Tagged

javascript fade animation jcarousel jcarousellite


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

cristianaSpot
LeeRJohnson
sampler
smonteru


jCarousellite Fade Animation


 / Published in: JavaScript
 

Set the background of the division that is the container to the image of the item that appears.

  1. $j(function() {
  2. $j(".anyClass").jCarouselLite({
  3. btnNext: ".next",
  4. btnPrev: ".prev",
  5. circular: true,
  6. visible: 1,
  7. scroll: 1,
  8. start: 1,
  9. auto: 8500,
  10. speed: 0,
  11. beforeStart: function(a) {
  12. $j(a).parent().fadeTo(1000, 0);
  13. var bg = $j(a).find('img').attr('src');
  14. $j('.anyClass').css({
  15. backgroundImage: "url("+bg+")"
  16. }, 1000);
  17. },
  18. afterEnd: function(a) {
  19. $j(a).parent().fadeTo(1000, 1);
  20. }
  21. });
  22. });

Report this snippet  

You need to login to post a comment.