JSFiddle - React, Tailwind, and code Playground
HTML
<div onclick="window.location.href = 'main.php'" class="cust-quotes">
<blockquote data-timeout="2000"><p>one.</p><cite>USA today</cite></blockquote>
<blockquote data-timeout="2000"><p>two.</p><cite>USA today</cite></blockquote>
<blockquote data-timeout="2000"><p>three.</p><cite>USA today</cite></blockquote>
<blockquote data-timeout="2000"><p>four.</p><cite>USA today</cite></blockquote>
</div>
CSS
.cust-quotes {
width: 100%;
margin-left: auto;
margin-right: auto;
height:85px;
box-sizing: border-box;
position:relative;
margin: 30px auto 0px auto;
padding-bottom: 50px;
}
.cust-quotes blockquote {
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
text-align: center;
opacity: 0;
z-index: 0;
transition: opacity 0.5s ease-out 0s, transform 0.5s ease-in 0s;
}
/* IE < 10 fallback */
.no-csstransitions .cust-quotes blockquote,
.no-csstransforms .cust-quotes blockquote {
position:relative;
}
.cust-quotes blockquote:first-child {
opacity: 0;
transform: translateY(-10px) scale(1.1);
}
.cust-quotes blockquote:first-child + blockquote {
opacity: 1;
z-index: 1;
transition: opacity 1.6s ease 0s;
}
.cust-quotes blockquote p, .cust-quotes blockquote div{
font-weight:normal;
font-weight: 300;
margin-bottom: 10px;
}
JavaScript
function initQuoteCarousel() {
var $quotesWrapper = $(".cust-quotes");
var $quotes = $quotesWrapper.find("blockquote");
if (!$quotes.length) {
return;
}
var selectNextQuote = function() {
// keep move first quote in dom to the end to make continous
var $quote = $quotesWrapper.find("blockquote:first").detach().appendTo($quotesWrapper);
setTimeout(selectNextQuote, $quote.data("timeout"));
};
setTimeout(selectNextQuote, $quotes.filter(":first").data("timeout"));
}
$(function() {
initQuoteCarousel();
});