2017-03-17 37 views
0

我試圖設置自定義的寬度和高度上的收藏夾圖像彈出,但我得到的錯誤$(...).lightBox is not a functionjQuery的收藏夾不工作

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> 

有什麼建議嗎?

+0

可能是你需要初始化爲'$(A [數據燈箱=「simpleinvoice」])'正確的方法。但我不確定。可以嘗試將lightbox.min.js放置在body標籤的底部。 – user31782

回答

0

我認爲這將工作,如果你沒有大寫「B」在.lightBox

+0

不,那沒用 – Ankit