Jump to content

JQuery slideDown() after Ajax not working


robs99

Recommended Posts

Hey,

im trying to load new content through ajax in a div and instead of showing all the new content at once i want the div to slowly slide down and reveal the new content. For some reason its not working, the new content gets loaded and its shown at once. Here is a demo:

http://gator1016.hostgator.com/~youtubed/test/

And here is the JS code:

function loadnew() {
$('#divcontent').html('<img src="ajaxbar.gif">');
$.ajax({
    url: 'ajaxcontent.php',
    success: function(data){
        $('#divcontent').html(data);
        $('#divcontent').slideDown('slow');
        }
    });
}

 

Any ideas?

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/211597-jquery-slidedown-after-ajax-not-working/
Share on other sites

hello,

thanks for the replies. the thing is i dont want to hide the div before it loads, i just want it to scroll to the "new" height of the loaded content. i know it works if i scroll it up, load the content and then scroll it down. but i want to find a way to do this without having to hide or scroll the div up.

its hard to explain what im trying to achieve, i hope you understand what i mean :)

thanks in advance

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.