jQuery切换背景图

 

            $.each($("#top2>ul>li>a"),function(){
                $(this).css({
                background:function() {
                var j=$("#top2>ul>li>a").index(this);
                var temp="url(img/nav"+(j+1)+".jpg) no-repeat center top";
                return  temp;
                }
                });
            });

posted @ 2010-07-08 00:26  吕飞  阅读(2225)  评论(3编辑  收藏  举报