LoginSignup
0

More than 5 years have passed since last update.

slider メモ fade var

Last updated at Posted at 2017-06-15
  var fadeA = {
    width : 1000,
    height : 600,
    index : 0,
    parent : $("親要素"),
    activeA : $("子要素"),

    play : function(){
      fadeA.parent.find(fadeA.activeA).hide();
      fadeA.parent.find(fadeA.activeA).filter(":first-child").stop().fadeIn(1000);

      function interVal(){

        fadeA.parent.find(fadeA.activeA).filter(":first-child").fadeOut(1000)
        .next(fadeA.activeA).fadeIn(1000)
        .end().appendTo(fadeA.parent);

      }
      setInterval(interVal, 2000)
    },
  }
  fadeA.play();

ポイントは、
表示させておく画像は何か?
次に表示させる画像は何か?
最後に、繰り返させるために、appendさせるです。

では、参考までに

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0