怎样可以让页面静止,即不可点击?高手的近。。。 就是在一个页面上随便点个按钮,即让整个页面不可用,不可点击??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 没做过,听说可以做一个覆盖整个页面的div <script>function readonlyAll(){ var testStr = "" ; var tempElements = null; for(i=0; i<document.all.length; i++) { if(document.all(i).tagName=="INPUT") { tempElements = document.all(i); //将输入域变为只读 if(tempElements.type=="text") { tempElements.readOnly=true; } if(tempElements.type=="radio") { tempElements.disabled=true; } } //将选择域变为只读 if(document.all(i).tagName=="SELECT") { tempElements = document.all(i); tempElements.disabled = true; } //将选择域变为只读 if(document.all(i).tagName=="TEXTAREA") { tempElements = document.all(i); tempElements.disabled = true; } }}</script>在按纽中调用这个JS方法readonlyAll(). 这样可以么:点击完button4以后,让所有的button的onclick事件返回false<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Insert title here</title><script type="text/javascript"> function noclick() { var inputButton = document.getElementsByTagName("input"); var link = document.getElementsByTagName("a"); for (i = 0; i < inputButton.length; i++) { inputButton[i].onclick = function() { return false; } } }</script></head><body><input type="button" value="button1" onclick=javascript:alert("button1")><input type="button" value="button2"><input type="button" value="button3"><input type="button" value="button4" onclick="noclick()"></body></html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><style>#alldiv{left:0px;top:0px; width:100%; height:100%; display:none; position:absolute; z-index:100; background-color:red; filter:Alpha(opacity=10);}</style><SCRIPT LANGUAGE="JavaScript"><!--function showme(value){ if(value == 0) document.getElementById("alldiv").style.display = "block"; else if(value ==1 ) document.getElementById("alldiv").style.display = "none";}//--></SCRIPT><BODY><input type="button" value="页面不可用" onclick=" showme(0);"><div id="alldiv" ><center><input type="button" value="恢复原始页面" onclick=" showme(1);"></div></center></div></BODY></HTML> 8楼正解,除了html里的一点小错误(多了个</div>):<div id="alldiv" ><center><input type="button" value="恢复原始页面" onclick=" showme(1);"></center></div> hadoop 启动问题 java如何写包含文件 关于args的问题 关于java与硬件交互的问题,请高手回答! 如何在java程序中获取另外一个java进程的信息 急! 求救有关JEditorPane的setPage的问题 高分在线请教!!!这个错误是怎么回事 各位高手,在java程序中我想用properties文件,请问怎么在java程序中怎么调用,多谢赐教 一个小问题,郁闷中! 谁知道"小龙亭"新的网址 如何入门软件设计 求高手解决问题了
function readonlyAll()
{
var testStr = "" ;
var tempElements = null;
for(i=0; i<document.all.length; i++)
{ if(document.all(i).tagName=="INPUT")
{
tempElements = document.all(i);
//将输入域变为只读
if(tempElements.type=="text")
{
tempElements.readOnly=true;
}
if(tempElements.type=="radio")
{
tempElements.disabled=true;
}
}
//将选择域变为只读
if(document.all(i).tagName=="SELECT")
{
tempElements = document.all(i);
tempElements.disabled = true;
}
//将选择域变为只读
if(document.all(i).tagName=="TEXTAREA")
{
tempElements = document.all(i);
tempElements.disabled = true;
}
}}
</script>
在按纽中调用这个JS方法readonlyAll().
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
function noclick() {
var inputButton = document.getElementsByTagName("input");
var link = document.getElementsByTagName("a");
for (i = 0; i < inputButton.length; i++) {
inputButton[i].onclick = function() {
return false;
}
}
}
</script>
</head>
<body>
<input type="button" value="button1" onclick=javascript:alert("button1")>
<input type="button" value="button2">
<input type="button" value="button3">
<input type="button" value="button4" onclick="noclick()">
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<style>
#alldiv{
left:0px;
top:0px;
width:100%;
height:100%;
display:none;
position:absolute;
z-index:100;
background-color:red;
filter:Alpha(opacity=10);
}
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
function showme(value)
{
if(value == 0)
document.getElementById("alldiv").style.display = "block";
else if(value ==1 )
document.getElementById("alldiv").style.display = "none";}//-->
</SCRIPT>
<BODY>
<input type="button" value="页面不可用" onclick=" showme(0);">
<div id="alldiv" >
<center><input type="button" value="恢复原始页面" onclick=" showme(1);"></div></center>
</div>
</BODY>
</HTML>
<div id="alldiv" ><center><input type="button" value="恢复原始页面" onclick=" showme(1);"></center></div>