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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.