//
等待文档完成加载
$(document).ready(
function
()
{
//为颜色div赋默认宽度值(第一个span块)
$("div").width($("span").width());
//例遍所有span,以下$(this)均为各span块
$("span").each(function(){
//绑定鼠标进入事件
$(this).mouseover(function(){
//div颜色块使用动画效果,{}内为最终效果,速度为slow(也可以设置完成毫秒数)
$("div").animate({
//宽度设置为当前span宽度
width: $(this).width(),
//左边距设置为当前span的网页x坐标
marginLeft: $(this).offset().left
}
//显示速度
,"slow"
);
});
});
}
);
很简单,很优雅
摘自【 随想飞翔】 <script type="text/javascript" src="http://www.google.com/reader/ui/publis<script type="text/javascript" src="http://www.google.com/reader/public/javascript/user/00697638153916680411/state/com.google/broadcast?n=5&callback=grc_p(%7bc%3a%22green%22%2ct%3a%22%5cu8fd9%5cu4e9b%5cu6587%5cu7ae0%5cu4e5f%5cu503c%5cu5f97%5cu4e00%5cu770b%22%2cs%3a%22false%22%7d)%3bnew%20grc"></script>se%22%7D)%3Bnew%20GRC">


587



被折叠的 条评论
为什么被折叠?



