jquery几秒钟之后跳转页面


    <script>
            window.onload = function() {
                var el = document.getElementById('js-tip-timer'), i = 5;
                var interval = setInterval(function() {
                    if (i) {
                        el.innerHTML = i;
                        i--;
                    } else {
                        el.innerHTML = i;
                        // TODO set location
                        window.location.href = contentPath + '/index.html';
                    }
                }, 1000);
            }
        </script>

 

posted @ 2015-08-01 12:52  泶雪乖女  阅读(469)  评论(0编辑  收藏  举报