JQuery幻灯片:淡入淡出效果

时间:2017-01-19 20:41:56

标签: javascript jquery

我正在使用您可以在此处找到的JQuery幻灯片http://www.slidesjs.com/examples/standard/

但是淡入淡出效果不起作用,只在导航上有效!

<script>
    $(function() {
      $('#slides').slidesjs({
        width: 800,
        height: 400,
        play: {
          active: true,
          auto: true,
          interval: 3500,
          effect: {
          fade: {
            speed: 1000
          }
        }
          //swap: true
        },
        navigation: {
          effect: "fade"
        },
        pagination: {
          effect: "fade"
        },
        effect: {
          fade: {
            speed: 1000
          }
        }
      });
    });
  </script>

我还试图从代码的第一部分中删除速度,以便在初始播放时获得淡入淡出。

$('#slides').slidesjs({
  width: 800,
  height: 400,
  play: {
    active: true,
    auto: true,
    interval: 3500,
    effect: "fade"
    //swap: true
  },
  navigation: {
    effect: "fade"
  },
  pagination: {
    effect: "fade"
  },
  effect: {
    fade: {
      speed: 1000
    }
  }
});

2 个答案:

答案 0 :(得分:1)

我做了这个工作。根据{{​​3}},您可以将effect的{​​{1}}属性设置为字符串

查看jsfiddle:docs

play

答案 1 :(得分:0)

从代码的第一部分中删除速度将使淡入淡出处于初始播放状态。

&#13;
&#13;
Sub Evaluatecells()

lastrow = ActiveSheet.UsedRange.Rows.Count

For x = 2 To lastrow
        If Cells(x, 1).Value = 0 And Cells(x, 2).Value = 0 Then
            MsgBox ("Error - Values in A1 and B1 cannot be both 0.")
            Exit For
        ElseIf Cells(x, 1).Value = 1 And Cells(x, 2).Value = 1 Then
            MsgBox ("Error - Values in A1 and B1 cannot be both 1.")
            Exit For
        End If
    Next x

End Sub
&#13;
&#13;
&#13;