如何在javascript中停止随机效果

How to stop random effect in javascript

本文关键字:随机 javascript      更新时间:2023-09-26

大家好,我正在使用Codecanyon作为我的图片库。现在它是带有随机效果的动画图像。我想去掉随机效应。有什么建议吗?下面是动画的功能:

parseAnimationOptions: function (t) {
        var i, o = this,
            n = ["flipX", "flipY", "rollInX", "rollInY", "rollOutX", "rollOutY", "slideX", "slideY", "slideRow", "slideColumn", "fade"];
        return t.animation ? i = t.animation : "*" == o.options.animations ? (i = o.excludeAnimations(n),
         i = (Math.random() < .5 ? "" : "-") + i[Math.floor(Math.random() * i.length)]) : (o.selectedAnimations && o.selectedAnimations.length || (o.selectedAnimations = o.options.animations.split(":")),
          i = o.excludeAnimations("*" == o.selectedAnimations[0] ? n : o.selectedAnimations[0].split(",")),
          i = i[Math.floor(Math.random() * i.length)],
           o.selectedAnimations.splice(0, 1)), -1 == n.indexOf(i.replace("-", "")) && (i = "fade"), e.extend(!0, t, {
            animation: i,
            type: i.replace(/[XY-]/g, ""),
            dir: 0 == i.indexOf("-", 0) ? -1 : 1,
            axis: i.replace(/[^XY]/g, ""),
            duration: t.duration || o.options[i.replace("-", "") + "Duration"] || o.options.duration,
            easing: t.easing || o.options[i.replace("-", "") + "Easing"] || o.options.easing
        })
    }

这个代码在

页上
$(".magicwall").magicWall({
            maxItemWidth: 300,
            maxItemHeight: 240,
            animations: "rollOutY",
            flipXDuration: 500,
        });

从这些资源:http://teefouad.com/plugins/magicwall/demo15-public-methods.html按钮"仅限FlipX动画"

$(".btn.flipx").click(function(){
    $(".magicwall").magicWall("option", "animations", "flipX,-flipX");
}); 

所以你应该试试:

$(".magicwall").magicWall({
      maxItemWidth: 300,
      maxItemHeight: 240,
      animations: "rollOutY,-rollOutY",
      flipXDuration: 500,
});

我没有脚本,所以我不能测试这个。让我们告诉我你的结果。