G
G
gretyl0072019-01-31 18:38:03
css
gretyl007, 2019-01-31 18:38:03

How to make text appear and change?

Good afternoon.
There is a text:

<h3 id="text">We will <span id="green">8</span> your purchase.</h3>
<h3 id="text">We will  <span id="green">5</span> your purchase.</h3>
<h3 id="text">We will <span id="green">2<</span> your purchase.</h3>
<h3 id="text">We will<span id="green">3</span>your purchase.</h3>


It is necessary that the lines change each other every 5 seconds.
I was thinking of doing it with a function like this:

$(function(){
       var message = ['#text'];
function show()
       {  var text = message.shift();
          message.push(text)
          text(text).fadeIn(700, hide);
       }
       function hide()
       {
         delay(2000).fadeOut(700, show)
       }
      show()


But she doesn't work. Tell me what's the problem.

Example of such text on hpicheck.com

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nick Sdk, 2019-01-31
@gretyl007

https://jsfiddle.net/nick_sdk/y7qs5t1L/1/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question