<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>
解决方案 »
- 求一个JS的三级分类
- IE会自动记录下在Input里面输入的内容,用js提交表单了,但是IE就不能记录下来了,怎么解决?
- 如何在js函数里改变html页面上的控件的标题阿
- JS 外币兑换问题
- 遍历数组中的对象属性
- javascript版的朋友,帮个忙哟!!谢谢了
- a={"params.artId":TY.param.getParam("id")||bbsGlobal.artId,"params.item":TY.para
- 50分,不够再加
- 怎样处理TextArea,使之自动自适应文字行数的多少?
- IOS下如何实现网页上调用系统短信界面发送短信的功能(需要传递端口号和短信内容)
- <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^