Results 1 to 2 of 2

Thread: Centering Mike's DHTML scroller

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

    Default Centering Mike's DHTML scroller

    I need to position Mike's DHTML scroller in a centered page layout. The pages are .net aspx generated. So the widget is not finding the div ID in the page for it's x,y position. In other words it can be hard coded but then when the page is minimized or maximized the widget is out of alignment. I need the scroller to align itself inside the div/table layout so it will stay within the boundaries of the moving page.

    HELP!

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

    Default

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format when asking a question.

    Well, centering a relatively positioned DIV, as is the case here, is straightfoward enough in CSS. Unfortunately, a bug in IE means it won't work in that browser, but does in Firefox, Opera etc. Find the HTML code:

    Code:
    <div id="placeholder" style="position:relative; width:420px; height:32px; margin: 0 auto;"> </div>
    The code in red centers the scroller. Now, for a cross browser solution, you'd have to use some silly hack. Basically, by adding a style sheet like:

    <style type="text/css">

    body{
    text-align: center;
    }

    </style>

    You cause all elements within the page to be centered in IE, including the scroller. Of course you probably don't want everything centered, so one solution is to define a general DIV that surrounds the entire BODY, with that DIV's alignment set to left:

    Code:
    <body>
    <div style="text-align: left">
    rest of body goes here
    </div>
    </body>
    You can thank Bill Gates for the extra fun!

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
  •