发布:goodtext,分类:网站设计,2009-3-12 11:59:50
TEXTAREA自适应文字行数的多少
IE 5.5+ 可以用 overflow-y:visible
<textarea rows=1 name=s1 cols=27 style="overflow-y:visible">
</textarea>
图片等比例缩放 防止图片显示变形
function ReSizeimg(ImgD,iwidth,iheight) {
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
if(image.width/image.height>= iwidth/iheight){
if(image.width>iwidth){
ImgD.width=iwidth;
ImgD.height=(image.height*iwidth)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt=image.width+"×"+image.height;
}
else{
if(image.height>iheight){
ImgD.height=iheight;
ImgD.width=(image.width*iheight)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt=image.width+"×"+image.height;
}
ImgD.style.cursor= "pointer"; //改变鼠标指针
}
}
例子:<img src="图片路径" border="0" onload="ReSizeimg(this,200,100)"/>
onload="ReSizeimg(this,200,100)"/这个加入图片<img> 标签中, 宽高根据自己的需要自动设置。
按钮提交表单 一个表单提交到多个不同页面
<input name="image2" type="image" src="03.gif" width="115" height="36" border="0" onFocus="this.blur()" onClick="this.form.action='111.asp';this.form.submit()">
<input name="image3" type="image" src="04.gif" width="115" height="36" border="0" onFocus="this.blur()" onClick="this.form.action='222.asp';this.form.submit()">
文本框限制代码 (2009-3-12 11:46:20)
GTArticle V2.0风格模板制作中用到的标签 (2009-1-18 9:36:52)
简单新闻&文章发布管理系统2.0版(GTArticle V2.0 )下载 (2009-1-17 13:46:13)
Div+Css登陆窗体 用block挡住网页内容 (2008-10-25 19:47:42)
编写简单文章管理系统 - goodtext.org新闻&文章发布管理系统(GTArticle V1.0 ) (2008-10-19 8:58:16)
ASP动态网页下UTF-8页面乱码+GB2312转UTF-8 +生成UTF-8格式的文件(编码) (2008-10-2 8:20:12)
utf-8 网页不显示+utf-8网页乱码 (2008-8-28 8:21:36)
ul和li标签CSS样式表布局 (2008-8-27 8:42:21)
一个asp版XMLDOM的类 (2008-8-20 8:26:5)
数据操作函数 (2008-6-25 7:49:46)