Results 1 to 4 of 4

Thread: Scrollable Content III text dropping to bottom

  1. #1
    Join Date
    Nov 2008
    Posts
    43
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default Scrollable Content III text dropping to bottom

    1) Script Title: Scrollable Content III

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex11/scrollc2.htm (couldnt find link to third version on DD)

    3) Describe problem: When I have just a little bit of text in the scroller the text drops to the bottom of the div when the page loads

    heres an example of the problem

    http://clockworkorchestra.com/sS.html

  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

    Why would you setup a scroller for content that isn't large enough to warrant using a scroller? And just what should happen if you do?

    Anyways, you can try this, add the highlighted as shown:

    Code:
    function bottomwrite(){
    if (iens6){
    document.write('<\/div><\/div>\n');
    if(document.getElementsByTagName('div')[document.getElementsByTagName('div').length - 1].offsetHeight < scrollerheight){
    return;
    }
    if(sidecontrols){
    document.write('<\/td><td s . . .
    - John
    ________________________

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

  3. #3
    Join Date
    Nov 2008
    Posts
    43
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    thanks for the reply I'll try that out! The reason I asked is because on the site I will be adding text to the scroller over time so eventually it will just behave as a scroller but initially there won't be enough text in it to function as such.

  4. #4
    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

    I played around with it a bit more. This is invalid (from your demo's source code):

    Code:
    <div style="font-family:sans-serif;font-size:90%;margin-left:.5ex;margin-top:-.8em!important;margin-top:.2em;"><p>
    - Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed dictum. Pellentesque quis purus vitae risus cursus aliquet.
    </p>
    No closing div tag. Also, even correcting that will give problems (when applying my fix) in IE because of the margin-top:-.8em!important; bit. However, if one replaces the p with a nested div, margin-top:-.8em!important; is not required, so you can end up with:

    Code:
    <div style="font-family:sans-serif;font-size:90%;margin-left:.5ex;margin-top:.2em;"><div>
    - Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed dictum. Pellentesque quis purus vitae risus cursus aliquet.
    </div>
    </div>
    and it should work out fine.
    - John
    ________________________

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

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
  •