3.7 复选框的全选,多选,全不选,反选 <form name=hrong> <input type=checkbox name=All onclick="checkAll('mm')">全选<br/> <input type=checkbox name=mm onclick="checkItem('All')"><br/> <input type=checkbox name=mm onclick="checkItem('All')"><br/> <input type=checkbox name=mm onclick="checkItem('All')"><br/> <input type=checkbox name=mm onclick="checkItem('All')"><br/> <input type=checkbox name=mm onclick="checkItem('All')"><br/><br/>
<input type=checkbox name=All2 onclick="checkAll('mm2')">全选<br/> <input type=checkbox name=mm2 onclick="checkItem('All2')"><br/> <input type=checkbox name=mm2 onclick="checkItem('All2')"><br/> <input type=checkbox name=mm2 onclick="checkItem('All2')"><br/> <input type=checkbox name=mm2 onclick="checkItem('All2')"><br/> <input type=checkbox name=mm2 onclick="checkItem('All2')"><br/>
</form>
<SCRIPT LANGUAGE="javascript"> function checkAll(str) { var a = document.getElementsByName(str); var n = a.length; for (var i=0; i<n; i++) a[i].checked = window.event.srcElement.checked; } function checkItem(str) { var e = window.event.srcElement; var all = eval("document.hrong."+ str); if (e.checked) { var a = document.getElementsByName(e.name); all.checked = true; for (var i=0; i<a.length; i++) { if (!a[i].checked){ all.checked = false; break;} } } else all.checked = false; } </SCRIPT>
3.8 文件上传过程中判断文件类型 <input type=file onchange="alert(this.value.match(/^(.*)(\.)(.{1,8})$/)[3])">
不断地清空剪贴板: <body onload="setInterval('clipboardData.setData(\'Text\',\'\')',100)">
<script language="javascript" type="text/javascript"> //先复制一样东西,或者文本或者图片 if(clipboardData.getData("Text")||clipboardData.getData("HTML")|| clipboardData.getData("URL")) { alert("有效行为"); } </script>
全屏技术: 真正的全屏页面解决之道!(全代码) 真正全屏解决之道: 1.htm <html> <head> <title>无标题文档</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head>
<body onload="window.open('fullscreen.htm','','fullscreen=1,scroll=no');"> </body> </html>
fullscreen.htm <html> <head> <title>无标题文档</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <script language="javascript1.2"> <!-- function opensmallwin(myurl){ var w2=300;//想弹出窗口的宽度 var h2=100;//想弹出窗口的高度 var w3=window.screen.width/2-w2/2; var h3=window.screen.height/2-h2/2; window.open(myurl,'small','toolbar=no,location=no,directories=no,status=no,menubar=no, scrollbars=no,resizable=0,width='+ w2 +',height='+ h2 +',left='+ w3 +',top='+ h3 +''); } //-->
<!-- function modelesswin(url,mwidth,mheight){ if (document.all&&window.print) eval('window.external.m2_blocked(url,"","help:0;resizable:0;status:0;center:1; scroll:0;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")') else eval('window.open(url,"","width='+mwidth+'px,height='+mheight+'px,resizable=1, scrollbars=1")') } //-->
</script> </head>
<body scroll="no"> <div align="right"><a href="javascript:" onclick="window.close()">关闭 </a> </div> <p></P> <div align="right"><a href="javascript:" onclick="opensmallwin('login.htm')">登录 </a> </div>
<p></P> <div align="center"><a href="javascript:" onclick="modelesswin('login.htm',300,160)">用模态登录窗口</a> </div> </body> </html> 上一页 [1] [2] [3] [4] [5] [6] 下一页 |