weixin_33728268 2015-07-15 13:49 采纳率: 0%
浏览 35

jQuery动画内容更改?

I want to change the Content in a div with a animation or a fade or something ?

Is this possible ?

I load the Content over a Ajax Post request into a div.

function getPage(id) {

    jQuery.ajax({
        url: "./ajax/engine.php",
        data:'action='+id+"&userkey="+mykey,
        type: "POST",
        success:function(data){

        }
    });
}

At the Moment its like Booom there is the content when i click on a Navbar Point.

Thanks for all Ideas!

  • 写回答

1条回答 默认 最新

  • 狐狸.fox 2015-07-15 14:12
    关注

    if you want to show and hide a div with some effect. you can use this code:

    function getPage(id) {
        jQuery(id).hide('fast');
        jQuery.ajax({
            url: "./ajax/engine.php",
            data:'action='+id+"&userkey="+mykey,
            type: "POST",
            success:function(data){
               jQuery(id).html(data).show('slow');
            }
        });
    }
    

    I ref you to .show() and .hide() function. Jquery do some animation by itself and have many function for that. You can use .animate() and .toggle() too. but for your case, use show() and hide()

    评论

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码