Can I scroll to this DIV after load()?
<p>I am very sorry. This is follow up for my question here :
<a href="http://stackoverflow.com/questions/4424843/why-i-cant-get-this-jquery-code-to-work">Why I can't get this jquery code to work?</a></p>

<p>All the solutions worked actually its my mistake not explaining it well enough.</p>

<p>What happens is that I have this code to load more posts when it is clicked:</p>

<pre><code>// load more
$(".loadmore").click(function(){
    if ($.cookie('n_more')) {
        count = $.cookie('n_more');
        count++;
        $.cookie('n_more', count, { path: '/', expires: 100 });
    } else {
        $.cookie('n_more', 1, { path: '/', expires: 100 });
    }
    $(".QueryElement").trigger('change');
    var posts_visible = &lt;?php echo $news['num_per_page']; ?&gt;;
    var posts_more = &lt;?php echo $news['num_per_more']; ?&gt;;
    var newposition = posts_visible + (posts_more * $.cookie('n_more'));
    var lastpos = newposition;
    var thispost = $("#post-" + lastpos).position();
    $('html,body').animate({
        scrollTop: thispost.top
    },1000);
});
</code></pre>

<p>That code works fine for me because it calls the .QueryElement change trigger and the change trigger contains:</p>

<pre><code>    $(".QueryElement").change(function() {

    // i hide almost all code here i think they are not related to the issue
    $("#result").load('&lt;?php bloginfo('template_directory'); ?&gt;/GetResults.php?' + $.cookie('nw-query'));

    });
</code></pre>

<p>The logic is I am attempting to trigger change when the user clicks on load more posts, thats fine and the new posts get loaded, perfect. </p>

<p>But the scroll animation does not work, i think because the load() content happens at the same time and the animate scroll does not recognize the new post IDs that are being loaded?? I am not sure..</p>

<p>but I really want to know how to initialize that animate onclick and also guarantee that the load() function is done. I am not sure what to do from here.</p>

<p><strong>EDIT: Yes it works if I set the position to visible DIV/ID BEFORE the load() but can't get it to scroll while the new content is loaded into page and new divs are inserted.</strong></p>

<p>This works for example   <code>var lastpos = newposition - 1;</code> because I set it to one div back (before content is loaded via load more)</p>
