0

Can anyone help me. I have made looping using javascript but i dont know how to redirect after playing all the text animation. Here's my source code.

CSS

    <style>

    #wss{

        opacity:0;
        -webkit-transition:opacity 1.0s linear 0s;
        transition:opacity 1.0s linear 0s;
         font-family: 'Helvetica', Arial, sans-serif;
         font-size: 74px;
         font-weight: bold;
         color: #1abc9c;
    }
    #canvas{
        margin-left: auto;
         margin-right: auto;
         display: inline;
         position: fixed;
         top: 40%;
         left: 10%;
    }
    .iam{
        color: #b2b2b2;
         font-family: 'Helvetica', Arial, sans-serif;
         font-size: 74px;
         font-weight: bold;
    }

    </style>

JS

    <script>
        var wss_i = 0;
        var wss_array =["coffee addicted","<u>pixelpusher</u>","119.81.31.34","ryda.com"];
        var wss_elem;

        function wssNext(){
            wss_i++;
            wss_elem.style.opacity=0;
            if(wss_i > (wss_array.length - 1)){
                wss_i=0;
            }
            setTimeout('wssSlide()',1000);
        }

        function wssSlide(){
            wss_elem.innerHTML = wss_array[wss_i];
            wss_elem.style.opacity=1;
            setTimeout('wssNext()',2000);
        }

    </script>

HTML

</head>

<body>

    <div id="canvas"><span class="iam">i am.</span><span id="wss"></span> 
    </div>

<script>wss_elem = document.getElementById("wss"); wssSlide();
</script>
Brad
  • 159,648
  • 54
  • 349
  • 530
Red4x
  • 51
  • 1
  • 4
  • 2
    @Quentin This is not a duplicate of the question you linked to. This question is clearly asking about how to redirect **after animation**. – Brad Jul 08 '14 at 14:16
  • The title is what caused the problem. It should be "Redirect page after CSS transition" or something along those lines. – Smeegs Jul 08 '14 at 14:19
  • @Brad Though, the OP needs to decide/specify when exactly "*after*" should occur since the animations run continuously. – Jonathan Lonowski Jul 08 '14 at 14:21
  • @JonathanLonowski No doubt, but the point is that this question is not a duplicate. – Brad Jul 08 '14 at 14:23
  • @Smeegs Someone not reading the question is what caused the problem. Sure the title can be better, but folks using moderator tools without paying attention is really frustrating. – Brad Jul 08 '14 at 14:25
  • @Brad I agree to an extent, even the question is poorly worded. At no point does OP actually say that it's a CSS transition. I had to look through the code to see what he `meant` to ask. Part of getting help is learning how to properly ask a question. But I do 100% agree that the mod tool was abused in this case. – Smeegs Jul 08 '14 at 14:27
  • yea, what i mean is after all the transition. where to put ' window.location.href = url;' – Red4x Jul 08 '14 at 14:30
  • 1
    @Brad I'm personally 50/50. I think the other post does answer a large part of this question, it just doesn't say where the snippet should be placed for this scenario. – Jonathan Lonowski Jul 08 '14 at 14:31
  • @JonathanLonowski The discussion on Meta says that it doesn't matter if the questions answers are the same. The only time a question should be closed as a duplicate is if the actual question is a duplicate. Obviously the other question is useful to the person asking this question, and it should have been posted as a comment. – Brad Jul 08 '14 at 14:41

0 Answers0