<!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="请输入股票代码"onclick="this.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>
放到空间不显示png图片,把下面两段改成gif的
document.getElementById("img1").src = "images/" + document.getElementById("txt").value + ".gif";
<br><div class="navboxcont_77E711"><img src="images/600000.gif" id="img1" /></div></br>
就可以为什么呢,咋就不能显示png呢,本地测试好使啊

解决方案 »

  1.   

    浏览器地址里直接输入png地址好使吗?
      

  2.   

    是png的图片文件不存在或路径不正确?或者本地图片没传到服务器上?
      

  3.   

    浏览器地址里直接输入png地址好使吗?不好使,跳到http://swiftphp.com/notify/1.php
    输入gif的好使,国外的空间是png的图片文件不存在或路径不正确?或者本地图片没传到服务器上?我都上传了,都有文件的在images文件夹里分别有,gif和png两种,就是为了测试,不知道怎么回事
      

  4.   

    解决了charset=gbk 不识别,真不知道怎么回事,换成别的就好了
      

  5.   

    楼主本来就是很多时候图片就有差别的,要是有半透明效果,必须是png或者jif的。你转换一下格式试试
      

  6.   

    图片怎么跟charset=gbk有关系?还是你应用的问题
      

  7.   

    我也不知道怎么回事
    换成charset=gb2312或utf-8都能显示png图片,不过utf-8能显示png图片但字符为乱码,现在用gb2312可以了,用gbk就不好使,我也不知道这是为什么。反正是好了
      

  8.   

    width:expression(document.body.clientWidth-2 这句有问题