Results 1 to 5 of 5

Thread: Translucent Scroller centered

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

    Question Translucent Scroller centered

    1) Script Title: Translucent Scroller

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...centscroll.htm

    3) Describe problem:

    I love the scroller for presenting announcements and important dates on the webiste I'm working on, but I want the scroller box centered horizontally on the web page. I'm a newbie and don't know programming language, so I don't know what to add and where to enter it in the script. I hope someone can help. Thanks.

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

    Default

    Find the line:

    Code:
    document.write('<div style="position:relative;width:'+scroller_width+';height:'+scroller_height+';overflow:hidden;">
    and add to it the code in red:

    Code:
    document.write('<div style="position:relative;width:'+scroller_width+';height:'+scroller_height+';overflow:hidden;margin-left: 42%">
    Now, I'm sort of cheating, and this isn't perfectly centered, just a rough estimate.

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

    Default Error message

    I added the text in red, but when I try to preview the page I get an error message that says "unterminated string constant"

    I would have you look at the website, but I'm working offline until I get theis part figured out. The entire line, plus the part in red you supplied, reads:

    if (ie4||dom)
    document.write('<div style="position:relative;width:'+scroller_width+';height:'+scroller_height+';overflow:hidden;[COLOR="Red"]margin-left: 42%"><div id="canvas0" style="position:absolute;background-color:'+bgcolor+';width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div><div id="canvas1" style="position:absolute;background-color:'+bgcolor+';width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div></div>')
    else if (document.layers){
    document.write('<ilayer id=tickernsmain visibility=hide width='+scroller_width+' height='+scroller_height+' bgColor='+bgcolor+'><layer id=tickernssub width='+scroller_width+' height='+scroller_height+' left=0 top=0>'+scrollercontent[0]+'</layer></ilayer>')
    }

    I'm not sure wheat an unterminated string constant is, but I'm assuming the line should have ( ) at the beginning and end, which it does. Can you explain what that error is? Thanks.

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

    Default

    The code ;[color="Red"] within the above should not be there. In other words, the only addition to the original code that should be added is:

    margin-left: 42%

    at the very end.

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

    Default Solved

    That did the trick! Thanks so much.

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
  •