posts - 13, comments - 12, trackbacks - 0, articles - 0
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

计时跳转页面代码

Posted on 2006-11-28 15:15 winder 阅读(739) 评论(1)  编辑  收藏 所属分类: JavaScript
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
< html >
< head >
< meta  http-equiv ="Content-Type"  content ="text/html; charset=gb2312" >
< title > 计时跳转 </ title >
</ head >

< body  leftmargin ="0"  topmargin ="0" >
< table  border ="0"  align ="center" >
< tr >
< td >
< br >
< table  width ="194"  height ="113"  border ="0"  cellpadding ="0"  cellspacing ="0"   >
  
< tr >
    
< td >< href ="#" >< img  src ="images/ydzj.jpg"  width ="397"  height ="265"  border ="0" ></ a ></ td >
  
</ tr >
  
< tr >
    
< td  align ="center" >< div  id ="view" ></ div ></ td >
        
< script >
            
var  time  =   5000 ;
            
var  cc  =  time / 1000 ;
            
function  count() {
                
if (cc  >   - 1 ) {
                    
var  vv  =  document.getElementById('view');
                    vv.innerHTML 
=  ' < font color = " #0066ff "  size = " 2 " >< font color = " red " > ' + cc + ' </ font > 秒后进入新页面 </ font > ';
                    cc
-- ;
                    setTimeout(
" count() " , 1000 ); // 1秒延时
                }
else {
                    goto();
// 进入新页面
                }

            }

            
function  goto() {
                location.href
= '#';
            }

            count();
        
</ script >
  
</ tr >
</ table >
</ td >
</ tr >
</ table >
</ body >
</ html >

评论

# re: 计时跳转页面代码  回复  更多评论   

2007-02-25 17:16 by 冰雪尘沙
http://jywl06.blog.163.com/blog/static/141775620071253233739/

只有注册用户登录后才能发表评论。


网站导航:
博客园   IT新闻   Chat2DB   C++博客   博问