简体   繁体   English

当在Jquery中单击图像时,为什么图像显示在下面?

[英]why image display below when click on image in Jquery?

can you please tell me why my image display below when I click the thumb nail image.I am using lightbox plugin I study doc from here https://github.com/lokesh/lightbox2/ In example it show image above the image..which css file I am missing ? 您能告诉我为什么我单击缩略图图像时在下面显示图像吗?我使用的是灯箱插件,我在这里研究文档https://github.com/lokesh/lightbox2/例如,它在图像上方显示图像。我缺少哪个CSS文件? fiddle http://jsfiddle.net/xnhtg1t1/ 小提琴http://jsfiddle.net/xnhtg1t1/

<a class="example-image-link lightbox" href="https://dl.dropboxusercontent.com/s/51wtwmqnnokotj6/image-1.jpg?dl=0" data-lightbox="example-1"><img class="example-image" src="https://dl.dropboxusercontent.com/s/w85pcbopymjzn76/thumb-1.jpg?dl=0" alt="image-1" /></a>

Remove the GET variable ?dl=0 from your JS and CSS urls and it works. 从您的JS和CSS网址中删除GET变量?dl=0 ,它可以工作。 jsFiddle Demo jsFiddle演示

That is Dropbox's download parameter , while although it is set to false.. it is still causing the issue. 这是Dropbox的download参数 ,尽管将其设置为false ..仍然会导致问题。

Make position of the Lightbox absolute instead of relative. 将灯箱的位置设为绝对位置,而不是相对位置。

.lightbox {
   position: absolute;
}

Or even FIXED. 甚至是固定的。 And then it will appear on top of the page. 然后它将显示在页面顶部。 Then you can construct the lightbox styles however you like. 然后,您可以根据自己的喜好构建灯箱样式。

http://jsfiddle.net/xnhtg1t1/2/ http://jsfiddle.net/xnhtg1t1/2/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM