I'm currently experiencing some problems with the jQuery cycle plugin while attempting to cycle through a string of divs.
The text is vertical-align: middle;
but as soon as a new div is added and the plugin is initiated the text aligns to the top of the page.
Here's my code:
HTML:
<div id="splash-container" style="background-color: #fac4c8; color: #003738">
<div class="slides">
<div class="text">
test-01
</div>
</div>
</div>
CSS:
#splash-container {
position: fixed;
z-index: 9998;
height: 100%;
width: 98%;
left: 1%;
cursor: pointer;
}
.slides {
position:relative;
display: table;
vertical-align: middle;
left: 0px;
height:100%;
width:100%;
}
.text {
display: table-cell;
vertical-align: middle;
font-family:'Avenir LT W02 65 Medium', Helvetica, sans-serif;
font-size: 15px;
line-height: 12px;
text-align: left;
padding-left: 20%;
padding-right: 20%;
}
jQuery:
$(function() {
$('.slides').cycle();
});
A working demo here too: http://jsfiddle.net/ZdLHh/
I was trying to add more .text
slides and cycle through them in a loop, while retaining them being aligned to the middle of the page but as soon as another slide is added and the plugin is fired the text is aligned to the top of the page?
Can't seem to figure it out