jquery 灯箱不工作

jquery lightbox is not working

我正在尝试在灯箱图片弹出窗口中设置自定义宽度和高度,但出现错误 $(...).lightBox is not a function

Jquery版本:1.12

灯箱版本:2.9

以下是我的 html 代码:

<html>
    <head>
            <script src="js/jquery.js"></script>
            <link href="css/lightbox.min.css" rel="stylesheet">
            <script src="js/lightbox.min.js"></script>  
            <script>
                $(document).ready(function(){
                    $('a').lightBox({
                          maxHeight: 700, 
                          maxWidth: 700
                    });
                });
            </script>
    </head>

    <body>
        <a style="color: blue" href="images/sampleinvoice.jpg" data-lightbox="sampleinvoice" data-title="Sample Invoice">Sample Invoice</a>
    </body>

</html>

有什么建议吗?

我认为如果您不将 .lightBox 中的 "B" 大写,它会起作用。

深入研究 http://lokeshdhakar.com/projects/lightbox2/#options 后,我发现以下是自定义灯箱的正确方法

                lightbox.option({
                    maxHeight: 1000, 
                      maxWidth: 1250
                });