Reply To: js.scripts delay for slidetext

Support Forums Gris – HTML Template js.scripts delay for slidetext Reply To: js.scripts delay for slidetext

#5456
CreaboxThemes
Keymaster

Hi,

yes, that is possible. You have to make two changes.
First, edit the function messageRotate(index) in the file scripts.js to this one:

function messageRotate( index ) {
     var prev = ( (index == 0) ? (messageMax) : (index - 1) );
     var next = ( (index == messageMax) ? 0 : (index + 1 ) );

     setTimeout ( function () {
          $(messageArray[prev]).fadeOut();
          setTimeout ( function () {
               $(messageArray[index]).fadeIn();
               setTimeout ( function () {
                    messageRotate(next);
               },$(messageArray[index]).data('time') );
          },1000 );
    },2000 );
}

Second, in your main file index.html, add the attribute data-time to each message in this way:

<div class="messages">
     <h2 data-time="5000">We are <strong>creative</strong> people</h2>
     <h2 data-time="2000">We <strong>love</strong> what we do</h2>
     <h2 data-time="5000">We <strong>build</strong> websites</h2>
     ...
</div>

Regards