如何在javascript中停止随机效果

时间:2014-07-17 06:00:10

标签: javascript jquery

嘿伙计们我正在使用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,

        });

1 个答案:

答案 0 :(得分:0)

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

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

所以你应该尝试:

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

我没有脚本所以我无法对此进行测试。让我们告诉你你的结果。