17DST's Archiver

选择DST!支持DST!

缘亦如此 发表于 2007-9-14 08:35

我来开第一贴,模仿韩国GOOGLE的特效

演示地址:[url]http://bbs.6co.cn/a/b/google.htm[/url]

把鼠标移到文字上即可看到效果![code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<title>测试效果</title>
<style type="text/css">
<!--
body {text-align:center}
table {border:1px solid #eeeeee;padding:3px 0;border-bottom-width:5px}
.icon td {width:50px;height:37px;background-image:url(http://bbs.6co.cn/a/b/svc_sprite_all.gif)}
.capt td {font:normal 11px verdana;padding:2px 0}
.a {background-position-y:0px}
.b {background-position-y:-37px}
.c {background-position-y:-74px}
.d {background-position-y:-111px}
.e {background-position-y:-148px}
.f {background-position-y:-185px}
.g {background-position-y:-222px}
.f1 {background-position-x:0px}
.f2 {background-position-x:-51px}
.f3 {background-position-x:-101px}
.f4 {background-position-x:-153px}
.f5 {background-position-x:-205px}
.f6 {background-position-x:-257px}
.f7 {background-position-x:-309px}
-->
</style>
<script language="javascript">
window.onload=function(){
   var t=document.getElementsByTagName('table')[0];
   var cs=t.rows[1].cells,ct=t.rows[0].cells;
   for(var i=0;i<cs.length;i++)
     cssAni(cs[i],ct[i],7);
}
function cssAni(osrc,otarget,num,duration){
   ////////
   //IE only
   //by mozart0, 2007.06.09
   ////////
   var t=null,c=1,d=0,n=0,i=Math.floor((duration||300)/num);
   var s=otarget.className.replace(/.$/,''),r=/over/;
   osrc.onmouseover=osrc.onmouseout=function(e){
     n=r.test((e||event).type)?1:-1;
     if(!t) t=setInterval(function(){
       if((c==1||c==num)&&((d==n||c+n<1)||!(d=n)))
           return clearInterval(t),t=null;
       otarget.className=s+(c+=d);
     },i);
   };
}
</script>
</head>
<body>
<table>
   <tr class='icon'>
     <td class='a f1'></td>
     <td class='b f1'></td>
     <td class='c f1'></td>
     <td class='d f1'></td>
     <td class='e f1'></td>
     <td class='f f1'></td>
     <td class='g f1'></td>
   </tr>
   <tr class='capt'>
     <td><a href='#;'>A</a></td>
     <td><a href='#;'>B</a></td>
     <td><a href='#;'>C</a></td>
     <td><a href='#;'>D</a></td>
     <td><a href='#;'>E</a></td>
     <td><a href='#;'>F</a></td>
     <td><a href='#;'>G</a></td>
   </tr>
</table>
</body>
</html>[/code]

cnvery 发表于 2007-9-16 16:28

谢谢分享:lol

£翱翔白鹭 发表于 2007-10-29 13:27

蛮好玩的呵``

Danny 发表于 2007-11-3 19:13

没有反应?我用FIREFOX

husion 发表于 2007-12-22 14:59

学习到新东东罗!嘻嘻!!谢谢!

MC琦 发表于 2007-12-23 12:15

可以用在导航上吗

Inuyasha 发表于 2007-12-23 14:19

囧,原来在原图片上做了手脚~看完图片我都快喷饭了

lai236994 发表于 2007-12-27 15:29

回复 1# 的帖子

做的非常好,:victory:

minger2manfi 发表于 2007-12-28 04:37

这是不错的东西...
可惜暂时对于我来说是没有用..!!:L

mingyan 发表于 2007-12-29 05:56

可以在FF下无效

loveapple 发表于 2008-1-23 10:04

firefox上不好用

页: [1]

Powered by Discuz! Archiver 7.0.0  © 2001-2007 Comsenz Inc.