Javascript 使用动画滑动效果移动行

Javascript 使用动画滑动效果移动行,javascript,jquery,Javascript,Jquery,在一个容器中,我有四行。每个都有不同数量的列。每当我点击每一行,它都会移动到下一行。但是,单击最后一行(到达最终位置的任何行)时,它应移动到第一行。我可以使用以下代码移动行,但我需要使用动画滑动效果移动行(这就是如何使用动画移动行) 你想要这样吗 $(".row").each(function() { $(this).click(function(){ if (($(this).next()).length === 1 ) { $(this).insertAfte

在一个容器中,我有四行。每个都有不同数量的列。每当我点击每一行,它都会移动到下一行。但是,单击最后一行(到达最终位置的任何行)时,它应移动到第一行。我可以使用以下代码移动行,但我需要使用动画滑动效果移动行(这就是如何使用动画移动行)

你想要这样吗

$(".row").each(function() {
  $(this).click(function(){
    if (($(this).next()).length === 1 )
    {
      $(this).insertAfter($(this).next()).hide().show('slow');;
    }
    else
    {
      $(this).insertBefore($(this).siblings().first()).hide().show('slow');;
    }
  });
});

你能发布你的html吗?
$(".row").each(function() {
  $(this).click(function(){
    if (($(this).next()).length === 1 )
    {
      $(this).insertAfter($(this).next()).hide().show('slow');;
    }
    else
    {
      $(this).insertBefore($(this).siblings().first()).hide().show('slow');;
    }
  });
});