0

我收到无效参数错误,无法弄清楚是什么原因造成的。

希望有人可以帮助我。

该脚本在这段(可能)代码之后停止运行:

if (type == "all") {
    var classe = target.substring(1) + '-' + color + '-bottom';
    $(target).after('<div class="' + classe + ' block"></div>');
    $('.'+classe).css({
        'height' : colors[color].botHeight,
        'background-image': "url(" + url + colors[color].bot + ")",
        'background-repeat': 'repeat-x'
    }); 
    $('.'+classe).offset({left: 0});
    $('.'+classe).width($(window).width());
}

完整脚本:http ://www.mochilao.syncmobile.com.br/wp-content/themes/headway/custom.js (对不起,混乱)

4

1 回答 1

0

你所有的变量都声明了吗?我看到使用了 5 个变量,但只声明了一个。

此外,如果“target”是一个字符串(您正在对其执行 .substring),那么将其包装在 jQuery 中并在下一行调用 .after() 没有多大意义。

我建议添加一些调试器或警报,并找出您的代码到底在哪里中断。

于 2012-03-13T01:31:49.583 回答