I am trying to move bxslider captions outside of slider. Since there is "overflow: hidden" I can't do it with just css.
What I am trying to do:
<div class="captions"></div> // I need display captions here
<ul>
<li><img src="images/1.jpg" title="Caption 1"></li>
<li><img src="images/2.jpg" title="Caption 2></li>
</ul>
Captions generated with this code:
var appendCaptions = function(){
// cycle through each child
slider.children.each(function(index){
// get the image title attribute
var title = $(this).find('img:first').attr('title');
// append the caption
if (title != undefined && ('' + title).length) {
$("this").append('<div class="bx-caption"><span>' + title + '</span></div>');
}
});
}
Bxslider creates that:
<div class="bx-wrapper">
<div class="bx-viewport">
<ul>
<li>
<img src="images/1.jpg" title="Caption 1">
<div class="bx-caption"><span>Caption 1</span></div> // I need to move caption outside of slider (bx-wrapper)
</li>
</ul>
</div>
</div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…