0
A
回答
0
要使用lightbox
为多张图片,你必须在href
设置不同id's
与data-toggle
属性设置为lightbox
。例如,如果你有四个图像,然后在html中创建这些超链接:
<a data-toggle="lightbox" href="#image1"><img src="image1.png"></a>
<a data-toggle="lightbox" href="#image2"><img src="image2.png"></a>
<a data-toggle="lightbox" href="#image3"><img src="image3.png"></a>
<a data-toggle="lightbox" href="#image4"><img src="image4.png"></a>
0
我可以给你简单的例子休息,你必须尝试
/* CSS only gallery (using radio inputs)
* See http://css-tricks.com/forums/topic/click-thumbnail-and-make-it-larger-image-image-gallery-wo-javascript/
* Support needed for IE7 & older - see http://css-tricks.com/child-and-sibling-selectors/
*/
.wrapper {
width: 700px;
position: relative;
}
.wrapper .thumbnails {
width: 150px;
float: right;
}
.wrapper a {
margin: 2px;
}
.wrapper img {
border: 1px solid #000;
}
.wrapper label > img {
opacity: 0.6;
}
.wrapper label > img:hover {
opacity: 1;
}
.wrapper input {
display: none;
}
.wrapper input:checked + .full-image {
display: block;
}
.wrapper input:checked ~ img {
opacity: 1;
}
.wrapper .full-image {
display: none;
position: absolute;
top: 0;
left: 0;
}
.wrapper .description {
width:95%;
padding:5px;
background-color:#DDDDDD;
}
<h2>Click on a thumbnail image</h2>
<div class="wrapper">
<div class="full-image"></div>
<div class="thumbnails">
<label>
<input type="radio" name="full-image" checked>
<div class="full-image">
<img src="http://lorempixel.com/530/400/nature/1" alt="Pic1" />
<div class="description">Description 1.</div>
</div>
<img src="http://lorempixel.com/65/65/nature/1"/>
</label>
<label>
<input type="radio" name="full-image">
<div class="full-image">
<img src="http://lorempixel.com/530/400/nature/2" alt="Pic2" />
<div class="description">Description 2.</div>
</div>
<img src="http://lorempixel.com/65/65/nature/2"/>
</label>
<label>
<input type="radio" name="full-image">
<div class="full-image">
<img src="http://lorempixel.com/530/400/nature/3" alt="Pic3" />
<div class="description">Description 3.</div>
</div>
<img src="http://lorempixel.com/65/65/nature/3"/>
</label>
<label>
<input type="radio" name="full-image">
<div class="full-image">
<img src="http://lorempixel.com/530/400/nature/4" alt="Pic4" />
<div class="description">Description 4.</div>
</div>
<img src="http://lorempixel.com/65/65/nature/4"/>
</label>
<label>
<input type="radio" name="full-image">
<div class="full-image">
<img src="http://lorempixel.com/530/400/nature/5" alt="Pic5" />
<div class="description">Description 5.</div>
</div>
<img src="http://lorempixel.com/65/65/nature/5"/>
</label>
<label>
<input type="radio" name="full-image">
<div class="full-image">
<img src="http://lorempixel.com/530/400/nature/6" alt="Pic6" />
<div class="description">Description 6.</div>
</div>
<img src="http://lorempixel.com/65/65/nature/6"/>
</label>
<label>
<input type="radio" name="full-image">
<div class="full-image">
<img src="http://lorempixel.com/530/400/nature/7" alt="Pic7" />
<div class="description">Description 7.</div>
</div>
<img src="http://lorempixel.com/65/65/nature/7"/>
</label>
<label>
<input type="radio" name="full-image">
<div class="full-image">
<img src="http://lorempixel.com/530/400/nature/8" alt="Pic8" />
<div class="description">Description 8.</div>
</div>
<img src="http://lorempixel.com/65/65/nature/8"/>
</label>
<label>
<input type="radio" name="full-image">
<div class="full-image">
<img src="http://lorempixel.com/530/400/nature/9" alt="Pic9" />
<div class="description">Description 9.</div>
</div>
<img src="http://lorempixel.com/65/65/nature/9"/>
</label>
<label>
<input type="radio" name="full-image">
<div class="full-image">
<img src="http://lorempixel.com/530/400/nature/10" alt="Pic10" />
<div class="description">Description 10.</div>
</div>
<img src="http://lorempixel.com/65/65/nature/10"/>
</label>
</div>
</div>
相关问题
- 1. jquery多个灯箱
- 2. 灯箱显示大图像
- 3. jQuery的灯箱组图像
- 4. jQuery灯箱或具有图像阵列的灯箱
- 5. 灯箱显示目录中的多个图像
- 6. 点击画廊没有灯箱在drupal(多个cck图像)
- 7. 为灯箱图像创建缩略图
- 8. 灯箱图像调整大小错误
- 9. 十字图像关闭灯箱
- 10. 灯箱加载,但图像不是
- 11. 视觉灯箱中的图像溢出
- 12. 给图像添加灯箱效果
- 13. 灯箱变更图像编程方式
- 14. 灯箱在图像右侧的描述?
- 15. 在jQuery中使用灯箱图像库
- 16. 灯箱图像全是黑白
- 17. jQuery灯箱单幅图像显示
- 18. 灯箱点击外部图像关闭
- 19. 灯箱ACF中继器单幅图像
- 20. 将图像动态加载到灯箱
- 21. 关于动态图像的jquery灯箱
- 22. 如何使一个jQuery的灯箱从一个链接打开多个图像?
- 23. prettyPhoto in bootstrap不加载灯箱
- 24. 灯箱 - 有1个图像链接到一个画廊
- 25. 灯箱,CSS和javascript
- 26. 灯箱:Highslide和Colorbox
- 27. IE6,灯箱和IFRAME
- 28. 我可以在灯箱内放置灯箱或图像映射吗?
- 29. bootstrap:多图像传送带只显示一张幻灯片
- 30. 如何链接到灯箱幻灯片中的特定图像?
你试过什么吗? – 2015-04-02 09:34:25