2013-10-15 98 views
0

因爲我更新colobox到1.4.15,我有一個問題:彩盒使2格在DOM

在DOM我有2的div id爲「顏色框」,一個是隱藏的,另一種可見:

隱藏的一個:

<div id="colorbox" class="" role="dialog" tabindex="-1" style="display: none;"> 
<div id="cboxWrapper"> 
<div> 
<div id="cboxTopLeft" style="float: left;"></div> 
<div id="cboxTopCenter" style="float: left;"></div> 
<div id="cboxTopRight" style="float: left;"></div> 
</div> 
<div style="clear: left;"> 
<div id="cboxMiddleLeft" style="float: left;"></div> 
<div id="cboxContent" style="float: left;"> 
<div id="cboxTitle" style="float: left;"></div> 
<div id="cboxCurrent" style="float: left;"></div> 
<button id="cboxPrevious" type="button"></button> 
<button id="cboxNext" type="button"></button> 
<button id="cboxSlideshow"></button> 
<div id="cboxLoadingOverlay" style="float: left;"></div> 
<div id="cboxLoadingGraphic" style="float: left;"></div> 
<button id="cboxClose" type="button"></button> 
<div id="cboxLikes" style="float: left;"></div> 
</div> 
</div> 
<div id="cboxMiddleRight" style="float: left;"></div> 
</div> 
<div style="clear: left;"> 
<div id="cboxBottomLeft" style="float: left;"></div> 
<div id="cboxBottomCenter" style="float: left;"></div> 
<div id="cboxBottomRight" style="float: left;"></div> 
</div> 
</div> 
<div style="position: absolute; width: 9999px; visibility: hidden; display: none;"></div> 
</div> 

可見一個

<div id="colorbox" class="cboxSlideshow_off" role="dialog" tabindex="-1" style="display: block; visibility: visible; top: 117px; left: 32px; position: absolute; width: 1200px; height: 631px;"> 
<div id="cboxWrapper" style="height: 631px; width: 1200px;"> 
<div> 
<div style="clear: left;"> 
<div id="cboxMiddleLeft" style="float: left; height: 564px;"></div> 
<div id="cboxContent" style="float: left; width: 858px; height: 564px;"> 
<div id="cboxLoadedContent" style="width: 858px; overflow: auto; height: 536px;"> 
<div id="cboxTitle" style="float: left; display: block;">LAN'Oween 2013</div> 
<div id="cboxCurrent" style="float: left; display: block;">Image 1 sur 36</div> 
<button id="cboxPrevious" type="button" style="display: block;">Précédante</button> 
<button id="cboxNext" type="button" style="display: block;">Suivante</button> 
<button id="cboxSlideshow" style="display: block;">Démarrer le diaporama</button> 
<div id="cboxLoadingOverlay" style="float: left; display: none;"></div> 
<div id="cboxLoadingGraphic" style="float: left; display: none;"></div> 
<button id="cboxClose" type="button">Fermer</button> 
</div> 
<div id="cboxMiddleRight" style="float: left; height: 564px;"></div> 
</div> 
<div style="clear: left;"> 
<div id="cboxBottomLeft" style="float: left;"></div> 
<div id="cboxBottomCenter" style="float: left; width: 858px;"></div> 
<div id="cboxBottomRight" style="float: left;"></div> 
</div> 
</div> 

初始化:

$("a.lightbox").colorbox(
    { 
     slideshow: true, 
     slideshowSpeed: 5000, 
     slideshowAuto: false, 
     slideshowStart: "Démarrer le diaporama", 
     slideshowStop: "Arrêter le diaporama", 
     current: "Image {current} sur {total}", 
     previous: "Précédante", 
     next: "Suivante", 
     close: "Fermer", 
     maxWidth: "95%", 
     maxHeight: "95%", 
     rel: 'teamzerty' 
    } 
    ); 

問題是我無法操作盒子。

我使用: - JQuery的2.0.0 - JQuery用戶界面1.10.3 - colobox 1.4.15

感謝的求助。

例:http://www.team-azerty.com/html/lan/lan-galerie-59-lan-oween-2013.html

回答

0

你應該永遠只在您的DOM使用一個ID一次 - 如果你發現自己需要使用一次以上,考慮將其更改爲一類,而不是一個ID!如果您嘗試多次使用ID,它將無法正常工作。

+0

是的,但它是colorbox插件誰似乎使2 div與2相同的ID ... – Aurelienazerty