2016-06-25 71 views
0

如何使用收藏夾-0.5 我的代碼是the jsfiddle如何使用在一個頁面中添加兩個畫廊收藏,0.5

<div id="thumbnails"> 
    <ul class="clearfix"> 

     <li><a href="http://thumb9.shutterstock.com/display_pic_with_logo/64681/296369042/stock-photo-common-modern-business-skyscrapers-high-rise-buildings-architecture-raising-to-the-sky-sun-296369042.jpg" title="Travancore Opus Highway Apartments" rel="lightbox"><img src="http://thumb9.shutterstock.com/display_pic_with_logo/64681/296369042/stock-photo-common-modern-business-skyscrapers-high-rise-buildings-architecture-raising-to-the-sky-sun-296369042.jpg" alt="turntable"></a></li> 
     <li><a href="http://thumb1.shutterstock.com/display_pic_with_logo/64681/296369060/stock-photo-sun-reflecting-in-a-usual-modern-business-skyscraper-high-rise-building-architecture-raising-to-296369060.jpg" title="Travancore Opus Highway Apartments" rel="lightbox"><img src="http://thumb1.shutterstock.com/display_pic_with_logo/64681/296369060/stock-photo-sun-reflecting-in-a-usual-modern-business-skyscraper-high-rise-building-architecture-raising-to-296369060.jpg" alt="turntable"></a></li> 
    </ul> 
    </div> 

請幫助..

+0

請別人幫助。 – ansarmon

回答

1

你必須在一個頁面中添加兩個畫廊寫爲

一個兩個獨立<ul>元素例如:

<!-- one set of images --> 
<ul class="gallery1"> 
    <li><a href="image2.jpg" rel="lightbox"><img src="thumb2.jpg"></a></li>  
    <li><a href="image3.jpg" rel="lightbox"><img src="thumb3.jpg"></a></li>  
    <li><a href="image4.jpg" rel="lightbox"><img src="thumb4.jpg"></a></li>  
</ul> 
<!-- another set of iamges --> 
<ul class="gallery2"> 
    <li><a href="image2.jpg" rel="lightbox"><img src="thumb2.jpg"></a></li>  
    <li><a href="image3.jpg" rel="lightbox"><img src="thumb3.jpg"></a></li>  
    <li><a href="image4.jpg" rel="lightbox"><img src="thumb4.jpg"></a></li>  
</ul> 

編輯:

也可以在javascript下使用。

$(function() { 

     $('.gallery1 a[rel*=lightbox]').lightBox(); 
     $('.gallery2 a[rel*=lightbox]').lightBox(); 
    }); 
+0

但這兩個畫廊的圖像都顯示在每個畫廊的彈出窗口中。 – ansarmon

+0

非常有幫助。謝謝親愛的。 – ansarmon

+0

您可以標記爲答案。 :) – Mad

相關問題