上传图片获取图片大小、高度和宽度,在线等。 图片长与宽不好获取的,自己来这个网站找找看有没有例子代码下载:http://www.sinlo.com 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>html-www.51windows.Net</title></head><body><script>var img=null;function s(){if(img)img.removeNode(true);img=document.createElement("img");img.style.position="absolute";img.style.visibility="hidden";img.attachEvent("onreadystatechange",orsc);img.attachEvent("onerror",oe);document.body.insertAdjacentElement("beforeend",img);img.src=inp.value;}function oe(){alert("cant load img");}function orsc(){if(img.readyState!="complete")return false;alert("高:"+img.offsetHeight+"\n宽:"+img.offsetWidth);}</script><input type="file" Name="file" id="inp" value="默认值"><br><input onclick="s()" type="button" value="点我一下给出要上传图片的大小及长、宽" name="button"></body></html> <div style="position: absolute; bottom: 10; right: 0; width: 150; height: 18;cursor:hand;z-index:100000;font:menu;background:infobackground;border:1 solid #999999;padding:4px;"> <A href="/data/" target=_blank><FONT color=red> DataCenter</FONT></A> <A href="/game/" target=_blank><FONT color=green> 在线小游戏</FONT></A> <input type="button" name="Button" value="源代码" onClick= 'window.location = "view-source:" + window.location.href'><SCRIPT LANGUAGE="JavaScript" src="/log/sitelog.asp"></SCRIPT></div><!-- 海娃@[email protected]@无忧视窗@http://www.51windows.net --> var imgSize={width=0,height=0}var GetImgSize=function(obj){var img=new Image();img.src=obj;imgSize.width=obj.offsetWidth;imgSize.height=obj.offsetHeight;return imgSize;} 把obj.offsetWidth改成img.width; 急!如何php用js实现联动时间选择框。 请问自定义的构造函数的实例化对象也继承了Object类了吗? 一张表单用到多个带提示的输入框该怎么做? Js 编码问题 javascript中字符串替换的函数? 怎样使文本框text中的金额值靠右对齐? 弹出窗口里的值回传到父窗口的问题,请大家进来帮帮忙,急呀 表单用ajax提交成功后,置为disabled,刷新后值还在,可能会造成重复提交 javascript中判断一个字符川是否是数字的函数是...,急,是inNumber()吗 显示对象的属性不正确,程序要怎么该 如何清空type=file控件内容 <span>标记中的内容应如何对齐
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>html-www.51windows.Net</title>
</head>
<body>
<script>
var img=null;
function s()
{
if(img)img.removeNode(true);
img=document.createElement("img");
img.style.position="absolute";
img.style.visibility="hidden";
img.attachEvent("onreadystatechange",orsc);
img.attachEvent("onerror",oe);
document.body.insertAdjacentElement("beforeend",img);
img.src=inp.value;
}
function oe()
{
alert("cant load img");
}
function orsc()
{
if(img.readyState!="complete")return false;
alert("高:"+img.offsetHeight+"\n宽:"+img.offsetWidth);
}
</script>
<input type="file" Name="file" id="inp" value="默认值"><br><input onclick="s()" type="button" value="点我一下给出要上传图片的大小及长、宽" name="button"></body>
</html>
<div style="position: absolute; bottom: 10; right: 0; width: 150; height: 18;cursor:hand;z-index:100000;font:menu;background:infobackground;border:1 solid #999999;padding:4px;">
<A href="/data/" target=_blank><FONT color=red> DataCenter</FONT></A> <A href="/game/" target=_blank><FONT color=green> 在线小游戏</FONT></A>
<input type="button" name="Button" value="源代码" onClick= 'window.location = "view-source:" + window.location.href'><SCRIPT LANGUAGE="JavaScript" src="/log/sitelog.asp"></SCRIPT></div>
<!-- 海娃@[email protected]@无忧视窗@http://www.51windows.net -->
width=0,
height=0
}var GetImgSize=function(obj){
var img=new Image();
img.src=obj;
imgSize.width=obj.offsetWidth;
imgSize.height=obj.offsetHeight;
return imgSize;
}