大家请帮我看看这个代码为什么不能再火狐里面正确执行呢……急!
辛苦大家!
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style>
* { font-size:12px;
width: 74px;
}
html { margin:0px; padding:0px; overflow:auto; }
body { margin:0px; padding:15px; background-color:buttonface; }
#w { position:absolute; width:480px; height:270px; overflow:hidden; border:2px groove #281; cursor:default; -moz-user-select:none; filter:alpha(opacity=100); }
#t { line-height:20px; height:20px; width:480px; overflow:hidden; background-color:#27C; color:white; font-weight:bold; border-bottom:1px outset blue; text-align:center; }
#winBody { height:248px; width:480px; overflow-x:hidden; overflow-y:auto; border-top:1px inset blue; padding:10px; text-indent:10px; background-color:white; }
</style>
<script>
var intervalProcess;
function sssss(o) {
clearInterval(intervalProcess); var i = 1, s = 0.02;
intervalProcess = setInterval(function() {
if (o.filters) {
if (o.filters[0].opacity > 0) { o.filters[0].opacity = o.filters[0].opacity - 2; }
}
else { i -= s; o.style.opacity = i; }
}, 1);
}
function xxxxx(o) {
clearInterval(intervalProcess); var i = 0, s = 0.02;
intervalProcess = setInterval(function() {
if (o.filters) {
if (o.filters[0].opacity < 100) { o.filters[0].opacity = o.filters[0].opacity + 2; }
}
else { i += s; var ss = document.getElementById('w'); o.style.opacity = i; }
}, 1);
}
</script>
</head>
<body>
<input id="Button1" type="button"onclick="xxxxx(w);" value="button" value="aaaa" />
<div id="w" onclick="sssss(this)">
<div id="t">我不是小强——墙</div>
<div id="winBody">cnblogs大家好</div>
</div>
</body>
</html>
filter:alpha(opacity=50); /* IE */
-moz-opacity:0.5; /* Moz + FF */
opacity: 0.5; /* 支持CSS3的浏览器(FF 1.5也支持)*/\
以上是针对png透明背景设置的相关属性
<script>
var intervalProcess;
function sssss(o) {
clearInterval(intervalProcess); var i = 1, s = 0.02;
intervalProcess = setInterval(function() {
if (o.filters) {
if (o.filters[0].opacity > 0) { o.filters[0].opacity = o.filters[0].opacity - 2; }
}
else { i -= s; o.style.opacity = i; }
}, 1);
}
function xxxxx() {
o=document.getElementById('w');
clearInterval(intervalProcess); var i = 0, s = 0.02;
intervalProcess = setInterval(function() {
if (o.filters) {
if (o.filters[0].opacity < 100) { o.filters[0].opacity = o.filters[0].opacity + 2; }
}
else { i += s; var ss = document.getElementById('w'); o.style.opacity = i; }
}, 1);
}
</script>
</head>
<body>
<input id="Button1" type="button" onclick="xxxxx();" value="button" value="aaaa" />
<div id="w" onclick="sssss(this)">
<div id="t">
我不是小强——墙</div>
<div id="winBody">
cnblogs大家好</div>
</div>
</body>
</html>
ff下要用document.getElementById來獲得對象哦。