当前位置:Gxlcms > JavaScript > javascript常用代码技巧大收集_表单特效

javascript常用代码技巧大收集_表单特效

时间:2021-07-01 10:21:17 帮助过:3人阅读

1.文本框焦点问题
onBlur:当失去输入焦点后产生该事件
onFocus:当输入获得焦点后,产生该文件
Onchange:当文字值改变时,产生该事件
Onselect:当文字加亮后,产生该文件
点击时文字消失,失去焦点时文字再出现
2.网页按钮的特殊颜色
style="background-color:rgb(235,207,22)">
3.鼠标移入移出时颜色变化
onMouseOver=this.style.color="red" class="button">
4.平面按钮

5.按钮颜色变化

6.平面输入框

7.使窗口变成指定的大小


Changing Background Colors





17.将按钮的特征改变

  本例按钮的代码如下:
onmouseout="this.className='style1'" class="style1">
18.改变按钮的图片.

  本例的按钮代码如下:
onmouseout="this.className='style3'" class="style3">
19.打印页面
打印本稿

20.可以直接写html语言
document.write("");
21.改变下拉框的颜色
>guoqiang99859
25.layer2为组件的ID,可以控制组件是否可见
document.all.item('Layer2').style.display = "block";
document.all.item('Layer2').style.display = "none";//
26.将页面加入favorite中

//
85.当前屏幕的分辨率
screen.width、screen.height//
86.设置表格中的内容
tbl.rows[0].cells[1].innerText=document.form.text1.value;//
87.本地快捷键

网上邻居


我的电脑


我的文档


回收站


target="_blank">控制面板


拨号网络(windows 2000)


88.IE菜单
//改变按钮上的图片
//创建新连接
//打印
//另存为htm
//另存为txt
document.execCommand("SaveAs")//保存为
document.execCommand('undo')//撤销上一次操作
89.web对话框
//
90.取第x,y的值
//
91.向新打开的网页上写内容
newwin=window.open('about:blank','','top=10');
newwin.document.write('');//
93.返回
javascript:history.go(-2);//
94.将页面上选中的内容复制到剪贴板
abcdefg
onclick="window.clipboardData.setData('text',document.selection.createRange().text);" value='复制页面选中
的字符'>//
95.将页面上选中的内容复制到剪贴板
kjhkjhkhkj////
96.鼠标移到下拉框时自动全部打开
//
97.获得本机的文件
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f1 = fso.GetFile("C:\\bsitcdata\\ejbhome.xml");
alert("File last modified: " + f1.DateLastModified); //
98.判断客户端是否是IE浏览器
因为 document.all 是 IE 的特有属性,所以通常用这个方法来判断客户端是否是IE浏览器 ,document.all?1:0;
99.创建新的下拉框选项
new Option(text,value)这样的函数//
100.在页面上画柱状图



%12
4人backdepth='15pt' on='true'/>


%12
4人backdepth='15pt' on='true'/>
//
101.饼图