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. Bootstrap燈箱干擾Bootstrap CSS
- 2. jquery多個燈箱
- 3. 燈箱顯示大圖像
- 4. 燈箱圖像下載
- 5. Ekko燈箱旋轉圖像
- 6. Squarespace燈箱圖像居中
- 7. jQuery的燈箱組圖像
- 8. 如何使用Bootstrap燈箱和AngularJS?
- 9. JQuery燈箱下一個圖像開關
- 10. Bootstrap燈箱不彈出
- 11. Angular Bootstrap燈箱參數
- 12. 燈箱 - 多張圖片
- 13. 加載Bootstrap燈箱在Magento中的產品圖像
- 14. jQuery燈箱或具有圖像陣列的燈箱
- 15. 點擊畫廊沒有燈箱在drupal(多個cck圖像)
- 16. 燈箱顯示目錄中的多個圖像
- 17. 多個RGB串色燈箱
- 18. Bootstrap燈箱在鏈接點擊後未顯示燈箱
- 19. 關閉當前燈箱後打開新的Bootstrap燈箱
- 20. 爲燈箱圖像創建縮略圖
- 21. 燈箱和CKEditor
- 22. 給圖像添加燈箱效果
- 23. jQuery燈箱單幅圖像顯示
- 24. 燈箱點擊外部圖像關閉
- 25. 燈箱打開但圖像不顯示
- 26. 燈箱包含圖像通過URL
- 27. 燈箱變更圖像編程方式
- 28. 打開燈箱喜歡圖像庫
- 29. 響應燈箱組合圖像
- 30. 燈箱ACF中繼器單幅圖像
你試過什麼嗎? – 2015-04-02 09:34:25