动画后重定向

时间:2014-07-08 14:14:29

标签: javascript css redirect

任何人都可以帮助我。我已经使用javascript进行循环,但我不知道如何在播放所有文本动画后重定向。这是我的源代码。

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>

0 个答案:

没有答案