今天练习了个Jquery淡入淡出的特性代码如下: 复制代码 代码如下: 无标题文档 <BR>#gallery1 {width:100%; overflow:hidden;} <BR>#gallery1 a {position:relative; float:left; margin:5px;} <BR>#gallery1 a span { display:none; background-image:url(zoom.png); background-repeat:no-repeat; width:48px; height:48px; position:absolute; left:15px; top:15px;} <BR>#gallery1 img { border: solid 1px #999; padding:5px;} <BR>#gallery1 a:hover span { display:block;} <BR>#gallery2 {width:100%; overflow:hidden;} <BR>#gallery2 a {position:relative; float:left; margin:5px;} <BR>#gallery2 a span { display:none; background-image:url(zoom.png); background-repeat:no-repeat; width:48px; height:48px; position:absolute; left:15px; top:15px;} <BR>#gallery2 img { border: solid 1px #999; padding:5px;} <BR> <BR>$(document).ready(function(){ <BR>$("#gallery2 a").append("<span>"); <BR>$("#gallery2 a").hover(function(){ <BR>$(this).children("span").fadeIn(600); <BR>},function(){ <BR>$(this).children("span").fadeOut(200); <BR>}); <BR>}); <BR> CSS solution jQuery solution 用到的图片:一个淡入淡出小例子: 复制代码 代码如下: Click Me contextcontextcontextcontext