Results 1 to 3 of 3

Thread: Scrollable Content II default content position?

  1. #1
    Join Date
    Aug 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Scrollable Content II default content position?

    1) Script Title: Scrollable Content II

    2) Script URL (on DD): http://dynamicdrive.com/dynamicindex11/scrollc2.htm

    3) Describe problem: I'm wondering if there is a way to automatically start the content div at the bottom. I'm going to be using this for a growing list of items and each new item that is added will be at the bottom of the list. I want to display the most recently added item by default (the bottom of the list). Is there a way to set this to default to the bottom? I suppose it could be a page onLoad thing because there won't be any dynamic content going in without a browser reload.

    Thanks!

    B

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Here is the function that is already used to slowly move to the bottom:

    Code:
    function movedown(){
    if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
    crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
    else if (ns4&&crossobj.top>=(contentheight*(-1)+100))
    crossobj.top-=speed
    movedownvar=setTimeout("movedown()",20)
    }
    You could make up a similar function:

    Code:
    function movedownfast(){
    if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100)){
    crossobj.style.top=parseInt(crossobj.style.top)-speed+"px";
    movedownfast();
    }
    else if (ns4&&crossobj.top>=(contentheight*(-1)+100)){
    crossobj.top-=speed;
    movedownfast();
    }
    }
    If you want this new function to run as soon as it can, find this function and add the red part:

    Code:
    function getcontent_height(){
    if (iens6)
    contentheight=crossobj.offsetHeight
    else if (ns4)
    document.nscontainer.document.nscontent.visibility="show"
    movedownfast();
    }
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks! I'll give this a try

    B

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
  •