Results 1 to 4 of 4

Thread: Pausing up-down message scroller

  1. #1
    Join Date
    Mar 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Pausing up-down message scroller

    Script:Pausing up-down message scroller
    http://www.dynamicdrive.com/dynamicindex2/crosstick.htm

    Is there anyway I can add some padding to the messages, so they don't butt right up against the edge of the message box?
    Thank!

  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

    Yes. First you need to take back a bit of the layout control from the script. Near the end, you will see these lines:

    Code:
    document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">')
    document.write(messages[0])
    document.writeln('</div>')
    document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden">')
    Get rid of the red parts.

    Now you can control these divisions from a style section that you can put in the head of the page (for example):

    Code:
    <style type="text/css">
    #main2 div div {
    margin:0 5px;
    width:140px;
    }
    </style>
    The important thing to note is that 140px is 10px less than the scroller width as set in the script's configuration:

    Code:
    var scrollerwidth='150px'
    This gives us 5px on either side for our margins as declared in the style section. If you use a different width scroller, adjust things accordingly.
    Last edited by jscheuer1; 03-04-2006 at 09:13 PM. Reason: add closing style tag
    - John
    ________________________

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

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

    Default

    Thanks! That's a great solution.

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Wow looking at this script it sure contains a lot of ugly and legacy code. But then again, I think this was one of the very first scripts I added to DD many years ago.

    I'll rewrite this script and probably post the new version sometime this week.

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
  •