如何去实现一个AJAX的另类过渡效果

             前段时间在做一个AJAX交互的时候需要做出一种渐变的效果,而大部分我们都是在用一个动态的图标显示给大家,可是这里就不太适合了,但是如果生硬的变化在美感上大大折扣,考虑了很久最后决定用叫javascript中的setTimeout去实现,自己的javascript能力真的是很弱,都是现在刚刚接触的,对于一个做WEB的人来说,这是很大的失败,于是去找资料最后终于作出了效果,很是不错哦,嘿嘿,现在很大家分享:
None.gif function  ondiggSuccess(result)
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif    document.getElementById('top_'
+result.id).style.filter="alpha(opacity=0)";
InBlock.gif    document.getElementById('top_'
+result.id).innerHTML ="<table width='100%' cellpadding='0' cellspacing='0'><tr><td valign='middle' align='center' style='font-size:12px; color:DarkGray; height:57px;'><font style=' font-size:large; color:Black; font-weight:bold;'>"+result.Diggcount+"</font></td></tr></table>";
InBlock.gif    setTimeout(
"document.getElementById('top_"+result.id+"').style.filter='alpha(opacity=10)'",100);
InBlock.gif    setTimeout(
"document.getElementById('top_"+result.id+"').style.filter='alpha(opacity=20)'",200);
InBlock.gif    setTimeout(
"document.getElementById('top_"+result.id+"').style.filter='alpha(opacity=30)'",300);
InBlock.gif    setTimeout(
"document.getElementById('top_"+result.id+"').style.filter='alpha(opacity=40)'",400);
InBlock.gif    setTimeout(
"document.getElementById('top_"+result.id+"').style.filter='alpha(opacity=50)'",500);
InBlock.gif    setTimeout(
"document.getElementById('top_"+result.id+"').style.filter='alpha(opacity=60)'",600);
InBlock.gif    setTimeout(
"document.getElementById('top_"+result.id+"').style.filter='alpha(opacity=70)'",700);
InBlock.gif    setTimeout(
"document.getElementById('top_"+result.id+"').style.filter='alpha(opacity=80)'",8000)
InBlock.gif    setTimeout(
"document.getElementById('top_"+result.id+"').style.filter='alpha(opacity=90)'",9000)
InBlock.gif    setTimeout(
"document.getElementById('top_"+result.id+"').style.filter='alpha(opacity=100)'",1000)
InBlock.gif    document.getElementById('mydigg_'
+result.id).innerHTML="<img src='/CommunityServerWeb20/Themes/default/images/digg-zhichi.gif' style='border:0px'/>"
ExpandedBlockEnd.gif}
这里主要是对一个层的透明度的调节,而且世界的间隔必须是有小大到,否则体现不出明显的效果,如果点击后数据处理正确,就调用这个JAVASCRIPT函数,效果就这样出现了,感觉还不错哦

转载于:https://www.cnblogs.com/lucangel/archive/2006/07/22/457077.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值