Results 1 to 2 of 2

Thread: Dynamic Ajax Content Scroll Problem

  1. #1
    Join Date
    Feb 2007
    Posts
    39
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Dynamic Ajax Content Scroll Problem

    1) Script Title:

    Dynamic Ajax Content

    2) Script URL (on DD):

    http://dynamicdrive.com/dynamicindex17/ajaxcontent.htm

    3) Describe problem:

    Well everything its working fine but there is just one little problem, I insert a document and at the bottom of it, has a Next link, the problem is that when the next part loads inside the div, the page stills on the bottom so you have to scroll all the way up to read from the beggining i have tried this.

    <h3><a name="ini">Top</a></h3>
    on the top of the next part of de doc.

    and in the link:
    <a href="javascript:ajaxpage('retrospectiva2.html#ini', 'polaroidfullbg');">next</a></span></p>

    thanks.

    Sorry about my poor english

  2. #2
    Join Date
    Feb 2007
    Posts
    39
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Sorry

    After a deep search i finaly found the answer in this forum, sorry for posting, anyway, heres the answer i found.

    You could try adding it here instead -

    Replace:

    Code:

    function loadpage(page_request, containerid){
    if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
    document.getElementById(containerid).innerHTML=page_request.responseText
    }

    with:

    Code:

    function loadpage(page_request, containerid){
    if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
    {
    document.getElementById(containerid).scrollTop=0;
    document.getElementById(containerid).innerHTML=page_request.responseText
    }
    }

    It did work here locally if I pasted the command into the address bar.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •