我正在嘗試設置一個旋轉的文本橫幅。橫幅是使用內聯樣式創建的。但是,我的腳本似乎超出了我的內聯樣式。JavaScript文本更改橫幅間隔 - 無點擊
以下是我有:
$(window).load(function(){
var cnt=0, texts=[];
// save the texts in an array for re-use
$(".textContent").each(function() {
texts[cnt++]=$(this).text();
});
function slide() {
if (cnt>=texts.length) cnt=0;
$('#textMessage').html(texts[cnt++]);
$('#textMessage')
.fadeIn('slow').animate({opacity: 1.0}, 5000).fadeOut('slow',
function() {
return slide()
}
);
}
slide()
div.textContent { display:none;}
<div id="textMessage"></div>
<div class="textContent"><h2 style="padding:6px !important; background-color:#003768 !important; color:#8DC63F !important; font-size:27px !important;"><em>
Outsourcing ATMs - the smarter solution.</em>
</h2></div>
<div class="textContent"><h2 style="padding:6px; background-color:#003768; color:#8DC63F; font-size:27px;"><em>
Who spends ALL DAY on ATM Management? <span style="color:white";>Outsource ATM</span></em>
</h2></div>
<div class="textContent"><h2 style="padding:6px; background-color:#003768; color:#8DC63F; font-size:27px;"><em>
Quality service companies anticipate the needs of their clients by providing solutions - not more work.</em>
</h2>
</div>
https://jsfiddle.net/arunpjohny/ow9h3vxq/1/?其他款式在哪裏 –
https://jsfiddle.net/arunpjohny/ow9h3vxq/2/ –