我正在尝试在灯箱图片弹出窗口上设置自定义宽度和高度,但我收到错误$(...).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>
有什么建议吗?
答案 0 :(得分:0)
我认为,如果你没有将&#34; B&#34;在.lightBox
。
答案 1 :(得分:-1)
在查看http://lokeshdhakar.com/projects/lightbox2/#options之后,我发现以下是自定义灯箱的正确方法
lightbox.option({
maxHeight: 1000,
maxWidth: 1250
});