jQuery的appendto()搬动

jQuery的appendto()移动var $self obj.find(ul:first)var lineHeight $self.find(li:first).heig

jQuery的appendto()移动

 var $self = obj.find("ul:first");     var lineHeight = $self.find("li:first").height(); //获取行高    $self.animate({ "marginTop" : -lineHeight +"px" }, 600 , function(){         $self.css({marginTop:0}).find("li:first").appendTo($self); //appendTo能直接移动元素

如果是选择的元素,追加就是移动
如果是新的元素如$("<li>1</li>").appendto($self)则是添加。