有个初学的人问怎么弄。花了我半小时

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New </title>
<meta name="Generator" content="Editplus">
<meta name="Author" content="bailing">
<meta name="Keywords" content="">
<meta name="Description" content="">
<style>
*
{font:12px verdana;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<body>
    

<div id="pageFrame" >

<href='#'  onclick='checkFramePageState(10,10)'>10</a>
</div>
<iframe name="baiduFrame" width=420 height=330 frameborder=1 scrolling=auto src="#"></iframe>

<script>
function checkFramePageState(pagex ,maxpage){
//..这里写上根据pagex来改变pageFrame内容的代码。赋予tmpstr
var urls='http://www.baidu.com/?page=';
var tmpstr = '';
var frameContainer = document.getElementById('pageFrame');
var newurl = urls+pagex;

document.frames['baiduFrame'].location
=newurl;

if(pagex>=maxpage)
{
    
for(i=pagex,n=pagex+10;i<=n;i++){
    tmpstr 
+="<a href='# ' onclick='checkFramePageState("+i+","+n+")'>第"+i+"页</a>\n";
    }
    frameContainer.innerHTML 
= tmpstr;
    }
    
//alert(tmpstr);
}

</script>

</body>
</html>



Posted on 2006-02-28 18:30  古代  阅读(581)  评论(0)    收藏  举报