简体   繁体   English

jQuery的Ajax加载内容动画?

[英]jquery Ajax loading Content animated?

Trying out atm something with Ajax loaded Content... 使用Ajax加载的内容尝试atm东西...

Iam done so far with loading it into the div but it looks like BOOM here is it when i change it .. 我到目前为止已经完成了将其加载到div中的操作,但是当我更改它时,它看起来像是BOOM。

So my Question is how can i animate it that its slide out the Div then it shows the Content... (this Step is easy..) but then when i click on next NavbarButton its changing the Content in the Div is changing animated or something in this way... 所以我的问题是我该如何动画化它,使其滑出Div,然后显示内容...(此步骤很容易..),但是当我单击下一个NavbarButton时,其在Div中更改的内容正在更改动画或以这种方式...

Here My Code so far 到目前为止,这里是我的代码

function getPage(id) {
 $("#output").slideToggle("slow");

var mykey = '<?php echo $_SESSION['xxxxxx']; ?>';
    $('#output').html('<center><img src="./images/icons/LoaderIcon.gif" /></center>');
    jQuery.ajax({
        url: "./ajax/engine.php",
        data:'action='+id+"&userkey="+mykey,
        type: "POST",
        success:function(data){$('#output').html(data);}
    });
}

And here the HTML 而这里的HTML

<div class="profil_posting_box">
<div  onClick="getPage('textposting');" class="profil_posting_kachel_1"></div>
<div  onClick="getPage('imageposting');" class="profil_posting_kachel_2"></div>
<div class="profil_posting_kachel_3"></div>
<div class="profil_posting_kachel_2"></div>
<div class="profil_posting_kachel_2"></div>
</div>
<div id="output"></div>

.

do it like this 像这样做

jQuery.ajax({
    url: "./ajax/engine.php",
    data:'action='+id+"&userkey="+mykey,
    type: "POST",
    success:function(data){
     $("#output").fadeOut('slow');
     $('#output').html(data);
     $("#output").fadeIn('slow');
   }
});

you may try advanced animation techniques other than fadeIn fadeOut using jquery animate 您可以尝试使用jani animate进行除fadeIn fadeOut之外的高级动画技术

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM