Ich versuche fadeToggle()
zu verwenden, um Text aus einem Array einzublenden, 10 Sekunden zu warten, dann für einen anderen Text auszublenden, um dasselbe zu tun.Fixieren von Text mit fadeToggle() in JQuery
Dieser Code wird der Text alle paar Sekunden perfekt wechseln, ich kann einfach nicht den richtigen Code bekommen, um es verblassen in/out:
var texts = [" \" It's really hard to design products by focus groups. A lot of times, people don't know what they want until you show it to them. \" <br /> ~ Steve Jobs ", " \" Design is not just what it looks like and feels like. Design is how it works \" <br /> ~ Steve Jobs", " \" That’s been one of my mantras — focus and simplicity. Simple can be harder than complex ; you have to work hard to get your thinking clean to make it simple. \" <br /> ~ Steve Jobs", " \" The present is theirs ; the future, for which I really worked, is mine. \" <br /> ~ Nikola Tesla ", " \” The value of an idea lies in the using of it. \“ <br /> ~ Thomas Edison "];
var count = 0;
$(document).ready(function() {
function changeText() {
$(".quote").html(texts[count]);
count < texts.length ? count++ : count = 0;
}
setInterval(changeText, 1000);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<h1 class="quote">Hello</h1>
Thank you! funktioniert super. –