<script type="text/javascript">
function obj(x){return document.getElementById(x);}
var intera;
var setep=5;
function sf(){
clearInterval(intera);obj("ms").innerHTML = '';
intera = setInterval(move,10);
function move(){
var sl = parseInt(obj("ss").style.left.replace("px",""));
if(sl<200){
obj("ss").style.left = (sl+setep)+"px";
obj("ss").style.opacity = (sl/200).toFixed(2);
obj("ms").innerHTML = obj("ms").innerHTML+"&nbsp;"+(sl/200).toFixed(2);
obj("ss").filters.alpha.opacity = parseInt(sl/200*100);
}
else{
clearInterval(intera);
}
}
}
function sf2(){
clearInterval(intera);obj("ms").innerHTML = '';
clearInterval(intera);
intera = setInterval(move,10);
function move(){
var sl = parseInt(obj("ss").style.left.replace("px",""));
if(sl>100){
obj("ss").style.left = (sl-setep)+"px";
obj("ss").style.opacity = (sl/200).toFixed(2);
obj("ss").filters.alpha.opacity = parseInt(sl/200*100);;
obj("ms").innerHTML = obj("ms").innerHTML+"&nbsp;"+(sl/200).toFixed(2);
}
else{
clearInterval(intera);
}
}
}
</script>

<label>
<input type="button" name="Submit" value="按钮" onmouseover="sf()" onmouseout="sf2()" />
</label>
<div style="width:100px; height:20px; background:#FF0000; position:absolute; top:100px; left:100px;filter:alpha(opacity=0);opacity:0;" id="ss"></div>
<div id="ms"></div>