<html>
<head>
<title> New Document </title>
<script>
var opa = 20;
var tm;
var curobj;
function Show(obj){
curobj = obj;
filterShow();}function filterShow(){
if(curobj==null)return;
opa+=2;
if(opa==102)opa=100;
curobj.style.filter="alpha(opacity=" + opa + ",style=0)";
tm = setTimeout(filterShow,20);}function resetFilter(obj){
curobj=null;
opa=20;
obj.style.filter="alpha(opacity=20,style=0);"}
</script>
</head><body>
<img src=abc.gif onmouseover="Show(this)" onmouseout="resetFilter(this)" style="filter:alpha(opacity=20,style=0)">
</body>
</html>
<head>
<title> New Document </title>
<script>
var opa = 20;
var tm;
var curobj;
function Show(obj){
curobj = obj;
filterShow();}function filterShow(){
if(curobj==null)return;
opa+=2;
if(opa==102)opa=100;
curobj.style.filter="alpha(opacity=" + opa + ",style=0)";
tm = setTimeout(filterShow,20);}function resetFilter(obj){
curobj=null;
opa=20;
obj.style.filter="alpha(opacity=20,style=0);"}
</script>
</head><body>
<img src=abc.gif onmouseover="Show(this)" onmouseout="resetFilter(this)" style="filter:alpha(opacity=20,style=0)">
</body>
</html>
解决方案 »
- 把一组radio切换成checkbox
- 关于表单提交的问题
- javascript定时滚动的问题
- javascript函数的返回值怎样赋给链接的num参数?
- marquee标签的使用
- RRS
- 怎么实现 鼠标点击表格行背景变色,移开后点击另一行时另一行变色而前一行恢复原来的背景色
- 为什么Media Player9不能触发EndOfStream事件
- 改代码,请教!!等!
- --------------javascript日期问题---------------
- <input> 分为 text、radio、等。。可不可以用text[i]或者radio[i]等调用控件
- 我想提交表到另一个帧,同时本帧也刷新,如何实现
B:移动后透明度
C:隐现速度
<html>
<head>
<title> New Document </title>
<script>
var sopa,fopa;
var tm;
var curobj;
var sp; //速度
function Show(obj){
curobj = obj;
try{
sopa = obj.filters.alpha.opacity;
}catch(e){};
if(sopa+"A"=="undefinedA")sopa=40;
fopa = Math.abs(obj.finishopa);
if(fopa+"A"=="NaNA")fopa=100;
sp = obj.speed;
filterShow();}function filterShow(){
if(curobj==null)return;
sopa+=6;
if(sopa>fopa)sopa=fopa;
curobj.style.filter="alpha(opacity=" + sopa + ",style=0)";
tm = setTimeout(filterShow,sp);}function resetFilter(obj){
curobj=null;
obj.style.filter="alpha(opacity=20,style=0);"}
</script>
</head><body>
<img src=c:/windows/BACKGRND.GIF speed=10 finishopa=60 onmouseover="Show(this)" onmouseout="resetFilter(this)" style="filter:alpha(opacity=20,style=0)">
</body>
</html>
function high(which2)
{
theobject=which2
highlighting=setInterval("highlightit(theobject)",50) //隐现速度(时钟控制,50毫秒一累加)
}
function low(which2)
{
clearInterval(highlighting)
which2.filters.alpha.opacity=20 //鼠标移开后的透明度(20%)
}
function highlightit(cur2)
{
if(cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=5 //隐现速度(每50毫秒透明度加5,直到完全不透明)
else if(window.highlighting)
clearInterval(highlighting)
}
</script>
<img src="图象文件" style="filter: alpha(opacity=20);" onMouseOver=high(this) onMouseOut=low(this)></a>//原透明度定义在style="filter: alpha(opacity=20);"中
如果还是看不明白,你可以试着改改上面几个数值,相信你会弄明白的^o^
function high(which2)
{
theobject=which2
highlighting=setInterval("highlightit(theobject)",50) //隐现速度(时钟控制,50毫秒一累加)
}
function low(which2)
{
clearInterval(highlighting)
which2.filters.alpha.opacity=20 //鼠标移开后的透明度(20%)
}
function highlightit(cur2)
{
if(cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=5 //隐现速度(每50毫秒透明度加5,直到完全不透明)
else if(window.highlighting)
clearInterval(highlighting)
}
</script>
<img src="图象文件" style="filter: alpha(opacity=20);" onMouseOver=high(this) onMouseOut=low(this)></a>//原透明度定义在style="filter: alpha(opacity=20);"中
如果还是看不明白,你可以试着改改上面几个数值,相信你会弄明白的^o^