$.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;
                }
                });
            });

相关文章: