Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery load html with ajax and let it slide in your page

Tags:

jquery

web

I'm making a webapge, and i need to load an html page in my home page with a clicking event. that is working fine.

my question is, is it possible to let the incoming html page to slide in the homepage?

i'm loading the html page with the following:

$.ajax({
    url: "gegarandeerd.html",
    dataType: "html",
    success: function(data) {
        $("#content").html(data);
    }
});​

how can i make the loaded data, slide in the page?

like image 988
Buit Avatar asked May 19 '12 11:05

Buit


1 Answers

This effect looks good.

$.ajax({
    url: "gegarandeerd.html",
    dataType: "html",
    success: function(data) {
        $("#content").fadeOut(function() {
            $(this).html(data).slideDown();
        });
    }
});​

The old content is fading out and the new content is sliding down.

DEMO: http://jsfiddle.net/2yJhc/

like image 86
VisioN Avatar answered Sep 24 '22 21:09

VisioN