首页一个搜索框,一个搜索按钮
下面一个css图片框.navboxcont_77E711 { width: 80px; height:80px}
搜索框,输入代码如00001,点击“搜索”
那么<div class="navboxcont_77E711"><img src="images/00001.png" /></div>如输入02023,单击“搜索”
那么<div class="navboxcont_77E711"><img src="images/02023.png" /></div>
等等
也就是搜索框输入的是什么代码,点击“搜索”后它就显示images文件夹里以这个代码为名称的图片,格式都是png的
打开页面吗默认显示为00001现在代码如下:<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>无标题文档</title>
<style type="text/css">.navboxcont_77E711 { width: 1028px; height:701px}.navboxauto_6B6CBB { margin-left:150px;width:auto; height:23px}#leftright, #topdown{position:absolute;left:0;
top:0;width:1px;height:1px;layer-background-color:red;
background-color:red;z-index:100;font-size:1px;}
</style>
<script type="text/javascript">
function Search(){
    document.getElementById("img1").src = "images/" + document.getElementById("txt").value + ".png";
}
</script>
</head>
<body>
<div class="navboxauto_6B6CBB"><input type="text" id="txt" size="49" value="请输入股票代码"/><input type="button" value="搜<>索"  onclick="Search()" /></div>
<br><div class="navboxcont_77E711"><img src="images/600000.png" id="img1" /></div></br><div id="leftright" style="width:expression(document.body.clientWidth-2)"></div><div
id="topdown" style="height:expression(document.body.clientHeight-2)"></div>
<script>
<!--
if (document.all&&!window.print){
leftright.style.width=document.body.clientWidth-2
topdown.style.height=document.body.clientHeight-2
}
else if (document.layers){
document.leftright.clip.width=window.innerWidth
document.leftright.clip.height=1
document.topdown.clip.width=1
document.topdown.clip.height=window.innerHeight
}
function followmouse1(){
//move cross engine for IE 4+
leftright.style.pixelTop=document.body.scrollTop+event.clientY+1
topdown.style.pixelTop=document.body.scrollTop
if (event.clientX<document.body.clientWidth-2)
topdown.style.pixelLeft=document.body.scrollLeft+event.clientX+1
else
topdown.style.pixelLeft=document.body.clientWidth-2
}
function followmouse2(e){
document.leftright.top=e.y+1
document.topdown.top=pageYOffset
document.topdown.left=e.x+1
}
if (document.all)
document.onmousemove=followmouse1
else if (document.layers){
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove=followmouse2
}
function regenerate(){
window.location.reload()
}
function regenerate2(){
setTimeout("window.onresize=regenerate",400)
}
if ((document.all&&!window.print)||document.layers)
window.onload=regenerate2
//-->
</script>
</body>
</html>以上代码已经正确了
现在想添加一段文字链接,就是“下一张”,和“上一张”
点击这个“下一张”,navboxcont_77E711图片框里的图片更改为images里当前图片的下一个图片文件,如images里的0001.png的下一张为0004.png,下一张为0005.png,下一张为0008.png......,当前为0001点击“下一张”,图片框换成0004.png,在点击“下一张”图片框换成0005.png,在点击“下一张”图片框换成0008.png......循环,当点击到最后一张时,再点击“下一张”回到第一张图片,也就是循环
点击“上一张”的和他效果相反,当碰到第一张图片再点击"上一张“时是显示最后一张,
也就是一个正循环显示,一个反循环显示
这个下一张和上一张该怎么写,按钮也行,能实现这个功能就行 ,还是在images文件夹里找(按图片文件在文件夹里的顺序),没有数据库的
参照网站是
http://www.yingfuwang.com/superview.php,他的那个上一张和下一张