<!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呢,本地测试好使啊
<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呢,本地测试好使啊
解决方案 »
- js读取asp的cookies来判断登录!
- Jquery的序列化方法为什么要把空格替换成加号呢?
- eval、escape和unescape ,帮我解释下这段代码
- 设置快捷键一点反应都没有。
- onclick事件,改<a href="#">的样式
- 有沒有好的JavaScript教學網站
- 请问,怎样能够判断一个文本框中输入的是数字,还是禁止的字符???isNAN可以用么?(急)
- js控制,点击button为什么不能提交表单
- 【求大神】HTMLEncode 问题
- on click事件,点击图片更换另一张图,求大神帮助
- 显示服务器时间JS是怎么弄的?
- jquery fadeTo 问题!导致页面卡死,请求帮助!
输入gif的好使,国外的空间是png的图片文件不存在或路径不正确?或者本地图片没传到服务器上?我都上传了,都有文件的在images文件夹里分别有,gif和png两种,就是为了测试,不知道怎么回事
换成charset=gb2312或utf-8都能显示png图片,不过utf-8能显示png图片但字符为乱码,现在用gb2312可以了,用gbk就不好使,我也不知道这是为什么。反正是好了