【问题标题】:How to animate the jquery ajax result instead of it jumping in如何为jquery ajax结果设置动画而不是跳转
【发布时间】:2013-06-17 15:55:58
【问题描述】:

我有一个栏,当您单击它时,它会向下滑动并显示一个微调器,然后触发一个 ajax 调用,结果替换微调器以显示它已完成。

我遇到的问题是数据比微调器高,所以它向下滑动并显示微调器,然后向下跳并显示 ajax 结果。

如何为 ajax 设置动画?

if(clicked_elem_lev == anslev){
    // Kick off ajax request for level information
    $.ajax({
        url:  base_url + "ajax/return_level_info/" + ccode + "/" + clicked_rec_id,
        cache: false
        }).done(function( html ) {
        $("#childof_" + anslevel + "_" + clicked_rec_id).replaceWith(html);
    });
}

其他代码都是动态的,所以如果很难显示,但这里有幻灯片 JS

$('#' + targ_elem_id).slideDown(slidetime);

【问题讨论】:

  • 您是否考虑过使用 CSS 隐藏 AJAX 内容,然后使用 jQuery 使用 done() 函数对其进行动画处理?

标签: jquery ajax jquery-animate


【解决方案1】:
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多