[英]Lightbox2: CSS set to display:none
I am trying to use Lightbox2, but it is not working at all when I click on the image. 我正在尝试使用Lightbox2,但是当我单击图像时它根本不起作用。
When I look in the Developer Console (Chrome), I can see that the overlay and the image is being added to the DOM, but its display
property is set to none
. 在开发人员控制台(Chrome)中查看时,可以看到叠加层和图像已添加到DOM,但是其
display
属性设置为none
。
display:none
This is my basic test code: 这是我的基本测试代码:
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="Script/jquery.js"></script>
<link href="Script/lightbox_dist/css/lightbox.css" rel="stylesheet">
</head>
<body>
<img src="Images/Gallery/27.jpg" data-lightbox="gallery" width="250"/>
<script src="Script/lightbox_dist/js/lightbox.js"></script>
</body>
</html>
Are you using the correct markup? 您使用的标记正确吗?
<a class="example-image-link" href="images/image-1.jpg" data-lightbox="example-1" data-title="Optional caption.">
<img class="example-image" src="images/thumb-1.jpg" alt="Two men in bicycle jerseys sitting outside at table having coffee">
</a>
<a class="example-image-link" href="images/image-2.jpg" data-lightbox="example-2" data-title="Optional caption.">
<img class="example-image" src="images/thumb-2.jpg" alt="Two men in bicycle jerseys sitting outside at table having coffee">
</a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.