在以下代码中 这句话的意思和作用是什么?
$(this).css({ "margin-left": "-120px"}).find(".Panel:last").prependTo(this);
/*完整代码段*/
$("#sysBodyer").find(".Panel:first").animate(
{ marginLeft: MoveSize+"px"},
1000,
function(){
/*下面这句不太理解*/
$(this).css({ "margin-left": Math.abs(MoveSize)+"px"}).find(".Panel:last").prependTo(this);
}
);

解决方案 »

  1.   

    //添加css样式,Math.abs()把负数转换成正数,find查找这个元素,prependTo添加到内部
    $(this).css({ "margin-left": Math.abs(MoveSize)+"px"}).find(".Panel:last").prependTo(this);
      

  2.   

    貌似margin设置为负数可以用来居中
      

  3.   

      在当前对象下添加样式:{ "margin-left": Math.abs(MoveSize)+"px"},然后在该对象下查找.Panel类,这个是.Panel是CSS的写法,我想你应该能看懂,你也许会问,为什么要在其后加last,意思就是找应用了.Panel样式的(last)最后一个元素.也就是last,合起来写不就是.Panel:last吗?,然后把这个元素添加到当前对象下,这里用了pretendTo方法!这样说应该还不好让你完全理解,你可以把他们一个一个猜解开来,单独执行,即可深入理解每个方法的涵义,仅此而已!