Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Display content based on current text

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #186933
    justdan
    Participant

    Hi guys. I’ve got a little project I’ve been practicing on to get better at larger JS projects and I’ve run into a little bug I’d like to ask about. The idea here was to fade in text in a setInterval function, and it works great. However, depending on what this text says, I would like to show and hide different content. This will happen each time the setInterval function fires. In theory this sounded like a legit solution, but if you look at the fiddle it appears to be a complete dumpster fire. What am I doing wrong here? Is this the best way to achieve what I’m after? Sorry if this seems like a complete noob question, but any input is always helpful. Thanks for your time.

    http://jsfiddle.net/deller26/p6fs0ouw/2/

    #186934
    Paulie_D
    Member

    However, depending on what this text says, I would like to show and hide different content.

    Where would the text be coming from?

    How would it change…will it change?

    I’m confused about a use case for this….

    #186937
    Paulie_D
    Member

    You mean a bit like this?

    http://codepen.io/Paulie-D/pen/hkLpz/

    #186939
    Paulie_D
    Member

    The fading would require a loop (I think)…my JQ is at a RTFM then C&P level.

    Text(ish) version to show that inner text is selectable and capable of being used as a variable.

    http://codepen.io/Paulie-D/pen/gLvBA

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.