Skip to content
Public Ticket #13248

jQuery Snippet skipping first item in list on first iteration

Conversation thread

PenciDesign replied

Staff Reply

Hi,

Sorry because we don't provide support for customization code like that.

Best Regards,

PenciDesign

efoxxhair started the conversation

Conversation Start

Hi, 

We have a jQuery snippet that rotates through a list of words. However, on the first rotation it is skipping just the first word. It works perfectly other than that. Any ideas on why and how to fix this?

Here is the jQuery snippet:

<h1 style="color:#ffffff; font-size:325%; text-align:center;"> Hi, I'm Braden ?</h1>
<h1 style="color:#ffffff; font-size:375%;text-align:center;">I think <span id="changing" style="color:#ffc72c">differently</span>.</h1>

<script>
;(function($){
    // your code
var texts = [
    "conceptually",
    "tactically",
    "systematically", "differently"
    ];
var count = 0;
function changeText() {
    $("#changing").fadeOut(500, function () {
      $(this).text(texts[count]).fadeIn(500);
    });
    count < 3 ? count++ : count = 0;
}
setInterval(changeText, 2250);
})(jQuery);
</script>

Want to join this conversation or access attachments? Sign in first.