日期:2014-05-19  浏览次数:20401 次

126邮箱样子的删除确认
提示对话框是,后面就变黑了

------解决方案--------------------
copy 别人的

html文件

<p> 测试 </p>
<input type= "button " value= "点击这里 " onClick= "sAlert( '光光为什么只有在事件里面执行sAlert才能用 ',this); " />
<p> 测试 </p>
<p> 测试 </p>
<p> 测试 </p>
<p> 测试 </p>
<p> 测试 </p>
<p> 测试 </p>
<p> 测试 </p>
<p> 测试 </p>
<table width= "200 " border= "1 ">
<tr>
<td> w </td>
<td> &nbsp; </td>
<td> &nbsp; </td>
</tr>
<tr>
<td> &nbsp; </td>
<td> ww </td>
<td> &nbsp; </td>
</tr>
<tr>
<td> &nbsp; </td>
<td> &nbsp; </td>
<td> w </td>
</tr>
</table>

<p>
<script language= "JavaScript " type= "text/javascript " src= "winner.js "> </script>
光光为什么只有在事件里面执行sAlert才能用, </p>
&lt;input type=&quot;button&quot; value=&quot;点击这里&quot; onClick=&quot;sAlert( '光光为什么只有在事件里面执行sAlert才能用 ',this);&quot; /&gt;
<p> &lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot; src=&quot;winner.js&quot;&gt;&lt;/script&gt; </p>
<hr>
<p> 这样就不行 </p>
<p> &lt;script language= 'javascript '&gt; </p>
<p> sAlert( 'winner ',this); </p>
<p> &lt;/script&gt; </p>
<p> &lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot; src=&quot;winner.js&quot;&gt;&lt;/script&gt; </p>
</body>
</html>
------解决方案--------------------
function sAlert(txt){
var eSrc=(document.all)?window.event.srcElement:arguments[1];
var shield = document.createElement( "DIV ");
shield.id = "shield ";
shield.style.position = "absolute ";
shield.style.left = "0px ";
shield.style.top = "0px ";
shield.style.width = "100% ";
shield.style.height = document.body.scrollHeight+ "px ";
shield.style.background = "#333 ";
shield.style.textAlign = "center ";
shield.style.zIndex = "10000 ";
shield.style.filter = "alpha(opacity=0) ";
shield.style.opacity = 0;
var alertFram = document.createElement( "DIV ");
alertFram.id= "alertFram ";
alertFram.style.position = "absolute ";
alertFram.style.left = "50% ";
alertFram.style.top = "50% ";
alertFram.style.marginLeft = "-225px " ;
alertFram.style.marginTop = -75+document.documentElement.scrollTop+ "px ";
alertFram.style.width = "450px ";
alertFram.style.height = "150px ";
alertFram.style.background = "#ccc ";
alertFram.style.textAlign = "center ";
alertFram.style.lineHeight = "150px ";
alertFram.style.zIndex = "10001 ";

strHtml = " <ul style=\ "list-style:none;margin:0px;padding:0px;width:100%\ "> \n ";
strHtml += " &