一旦将插件放入函数中,我就会收到错误

时间:2014-07-02 14:15:05

标签: javascript jquery html

我遇到此错误Uncaught TypeError: Cannot read property '1' of null时遇到问题。

因此,如果您在此处访问此页面:http://loai.directory/reiss/profile并查看控制台错误,您会发现Uncaught TypeError:无法读取属性' 1'为null

好吧,我使用的是网格系统,插件可以在这里找到:http://loai.directory/reiss/assets/js/grid-system.js

我在我创建的标签插件中有网格,标签功能的代码可以在这里找到:http://loai.directory/reiss/assets/js/main.js它被称为标签,它被放置在第58行... < / p>

因此,网格系统显示上面的错误,但是经过漫长的一天调试后,我发现当我删除了标签功能时,错误已经消失,网格系统完美运行!因此,由于标签功能而出现问题。

我的标签功能

更新

//Tabs ///
    $('.tabs').each(function() {
        var $tabs = $(this);
        $tabs.find('.section-body > div:not(:first-child)').hide().end().find('.section-head a:eq(0)').addClass('active').end().find('.section-head a').on('click', function() {
            $tabs.find('.section-head a').removeClass('active').end().find('.section-body > div:eq(' + $(this).index() + ')').show().siblings().hide();
            $(this).addClass('active');
        });
    });

当我删除那个位时,你看到$(this).index()的位,网格系统工作了!我现在相信Grid系统与$(this).index()的Tabs部分发生冲突,是否有其他方法可以在不使用$(this).index()的情况下实现相同的rusalts?或ID&#39;

0 个答案:

没有答案