1
    function ReInitializeCyclePlugin() {
    var el = $("#id");
    var eventobject = EVobject;
    var IdToInitialize = $(eventobject.currentTarget).attr("id");

    /* here first we are detaching the cycle plugin */
    el.find("#" + IdToInitialize).cycle("destroy");

    /* cycle plugin reinitializes here */
    el.find("#" + IdToInitialize).cycle({
        fx: $("#cyclescroll").val(),
        easing: $("#cyclebounce").val(),
        speed: 1000,
        timeout: 2000
    });
}

我只想根据用户给定的输入动态地重新初始化循环插件,我正在通过上面的代码进行尝试。但是有一些问题,它不起作用。它成功“销毁”但没有重新初始化。这里有什么问题?

4

1 回答 1

2

您是否尝试过将它们链接在一起? http://jsfiddle.net/lucuma/NTB4s/

el.find("#" + IdToInitialize).cycle("destroy").cycle({
    fx: $("#cyclescroll").val(),
    easing: $("#cyclebounce").val(),
    speed: 1000,
    timeout: 2000
});
于 2012-05-06T19:11:49.147 回答