jQuery脚本崩溃的网页

时间:2012-09-18 09:12:56

标签: javascript jquery

我有一个带旋转木马的页面使用无限轮播插件。

当我运行该页面时,它会崩溃我的浏览器并询问我是否要停止无响应的脚本。

在我的JS文件中调用我有的动作......

$(document).ready(function(){
    $('#viewport').carousel('#simplePrevious', '#simpleNext');
    $('.gallery-viewport-ext').carousel('.gallery-viewport-ext #simplePrevious', '.gallery-viewport-ext #simpleNext');
    $('.gallery-viewport-int').carousel('.gallery-viewport-int #simplePrevious', '.gallery-viewport-int #simpleNext');
    $('.gallery-viewport-gw').carousel('.gallery-viewport-gw #simplePrevious', '.gallery-viewport-gw #simpleNext');
    $('.gallery-viewport-theroofterrace').carousel('.gallery-viewport-theroofterrace #simplePrevious', '.gallery-viewport-theroofterrace #simpleNext');
    $('.gallery-viewport-photos').carousel('.gallery-viewport-photos #simplePrevious', '.gallery-viewport-photos #simpleNext');
    $('.gallery-viewport-onebedroomapartment').carousel('.gallery-viewport-onebedroomapartment #simplePrevious', '.gallery-viewport-onebedroomapartment #simpleNext');
    $('.gallery-viewport-twobedroomapartment').carousel('.gallery-viewport-twobedroomapartment #simplePrevious', '.gallery-viewport-twobedroomapartment #simpleNext');
    $('.gallery-viewport-externals').carousel('.gallery-viewport-externals #simplePrevious', '.gallery-viewport-externals #simpleNext');

    $('#slider-stage').carousel('#previous', '#next');  
    $('#tab-container').easytabs();

                //Examples of how to assign the ColorBox event to elements
                $(".group1").colorbox({rel:'group1'});
                $(".group2").colorbox({rel:'group2', transition:"fade"});
                $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});

    // Dropdown, show more text
    $('.useful-links ul li a').on('click', function () {
        $(this).next('p').toggle();   
        return false;  
    });
});

如果我删除

$('.gallery-viewport-int').carousel('.gallery-viewport-int #simplePrevious', '.gallery-viewport-int #simpleNext');

启动页面然后加载的页面的操作。

有人知道可能出现什么问题吗?或者我如何调试它?


<section class="gallery-viewport-int">
            <ul style="">
                <li style=""><img alt="image" src="_includes/images/slide-1.jpg"></li>
                <li style=""><img alt="image" src="_includes/images/slide-2.jpg"></li>
                <li style=""><img alt="image" src="_includes/images/slide-3.jpg"></li>
                <li style=""><img alt="image" src="_includes/images/slide-1.jpg"></li>
                <li style=""><img alt="image" src="_includes/images/slide-2.jpg"></li>
                <li style=""><img alt="image" src="_includes/images/slide-3.jpg"></li>
            </ul>
            <a id="simplePrevious"><img alt="Left Arrow" src="_includes/images/larr.png"></a>
            <a id="simpleNext"><img alt="Right Arrow" src="_includes/images/rarr.png"></a>
        </section>

0 个答案:

没有答案