灯箱正在新窗口中打开

时间:2014-04-12 19:53:28

标签: javascript jquery html css lightbox

我正在尝试在我的一个网页上使用灯箱,但是在加载jquery库和lightbox.js以及lighbox.css之后,当点击与灯箱相关联的图像时,它会在新窗口中打开。我发现如果我禁用我的标准jquery文件,灯箱工作正常。我对javascript和Jquery都很陌生,有谁能看出为什么这可能会干扰灯箱?

JS:

$(document).ready(function(){
    $("#menuButton").click(function(){
        $('#sideContent').toggleClass('hide');
        $('nav').toggleClass('hide');
        $('#key').toggleClass('big');
        $('#pageSize').toggleClass('big');
        $('#returnContainer').toggleClass('hide');
        $('#returnText').toggleClass('hide');
   });
});

$(document).ready(function () {
    $('#collapseGallery').click(function () {
        $('#galleryImg').toggleClass('hide');
    })
})


$(document).ready(function () {
    var $window = $(window),
        $key = $('#key'),
        topOffset = $key.offset().top;
        $window.scroll(function () {
            $key.toggleClass('fixed', $window.scrollTop() > topOffset);
    });
});


$(document).ready(function () {
    $('#returnContainer').click(function () {
        $("html, body").animate({ scrollTop: 0 }, 500);
    })
})

HTML(我的图库所在页面):

<!DOCTYPE html>
<html>

    <head>
      <!--  <link rel="stylesheet" type="text/css" href="css/style.css" /> -->
        <link rel="stylesheet" type="text/css" href="css/lightbox.css" /> 
        <script src="js/jquery-1.11.0.js"></script>
       <!-- <script src="js/js.js"></script>-->

        <title>School</title>
    </head>

    <body>
                <?php include ("aside.php"); ?>
                <div id="pageSize">
                <header class="pageHeader">
                    Schoolwork
                </header>
                    <div class="contentHeader">
                        <h1>Work From CCC</h1>
                    </div>
                <div class="content">

                <div class="hLine"></div>
                <p>Some text.</p>
                <br>

                <div>
                    <h1 id="collapseGallery">Contemporary Issues in Painting</h1>
                    <div id="galleryImg" class="hide">
                            <?php include 'images.php'; ?>
                    </div>
                </div>
                </div>
        </div>

    </body>

<script src="js/lightbox.js"></script>
</html>

谁能看到我出错的地方?

0 个答案:

没有答案