-7

我的控制台返回此错误:

Uncaught SyntaxError: Unexpected end of input 

我知道这意味着什么,但我找不到我没有正确关闭我的支架的地方。

这是我网站的 URL,http://bit.ly/KJz5pi

如果有人能解决它,我会非常高兴!谢谢。

- - - - - 编辑

我剪切了我的大部分代码,它只是在一小段代码中显示了这个错误:

$("#slider-index").bxSlider({
    delay: 3000,
    speed: 5000,
    pause: 1000,
    controls: false,
    auto: true,
    pager: false,
    adaptativeHeight: true,
    adaptativeWidth: true,
    mode: 'fade'
});


function persiana() {
    $('.one').animate({
        left: '-35px'
    }, 1500, 'linear', function() {
        $(this).css('left', '0');
        persiana();
    });
}

persiana();

然而,我没有看到错误,甚至 jshint.com 也没有找到它!

4

2 回答 2

2

用这个。粘贴到您的 JavaScript 中。快速。但是,我们无法牵你的手。Lint 会发现语法和逻辑错误。专注于语法错误,不要迷失在逻辑上。只要让你的代码工作。

http://www.javascriptlint.com/online_lint.php

于 2014-01-09T17:23:23.723 回答
2

我花了一点时间来调试你的代码,但我想我找到了问题所在。实际上,问题不在于您向我们展示的代码。问题出在其他地方。您错过了关闭两个功能。看下面的代码:

$(document).ready(function () {
        $(".newsletter").colorbox({
            iframe: true,
            width: "500px",
            height: "310px"
        });
        $(".mapa-site").colorbox({
            iframe: true,
            width: "600px",
            height: "420px"
        });
        $(".webdesign").colorbox({
            iframe: true,
            width: "450px",
            height: "300px"
        });
        $(".area-restrita").colorbox({
            iframe: true,
            width: "500px",
            height: "300px"
        });
        var posicao = $(".menu ul li a.active").parents().position().left + ($(".menu ul li a.active").parents().width() / 2) - 10;
        $(".bola").css({
            left: posicao
        });
        $(".menu ul li a").click(function (e) {
                e.preventDefault();
                var _this = $(this);
                var posicao = _this.parents().position().left + (_this.parents().width() / 2) - 10;
                $(".bola").animate({
                    'left': posicao
                }, 'slow');
                $(".menu ul li a").removeClass('active');
                $(this).addClass('active');
                var dataSlider = _this.attr('data-slide-index');
                var conteudoLi = $("#li_" + dataSlider).html();
                novoLeft = dataSlider * 964 * -1;
                if ($("#li_" + dataSlider).attr('data-height')) {
                    novoHeight = $("#li_" + dataSlider).attr('data-height');
                } else {
                    novoHeight = $("#li_" + dataSlider).outerHeight();
                }
                $('.viewport').animate({
                    left: novoLeft
                }, 'slow', 'swing');
                $('#content').animate({
                    height: novoHeight
                }, 'slow');

因此,如果您在该代码之后再添加两行,您的问题将得到解决。

     }); //For $("menu ul li a").click(function) {
}); // For $(document).ready(function) {
于 2014-01-09T18:19:26.727 回答