Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    AoB
    AoB is offline
    New to the CF scene
    Join Date
    Feb 2004
    Location
    Ireland
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Centering a Javascript scroller?

    Hi all,
    I'm new to the board, and hope I won't be annoying anyone by asking for some help on this topic. Thanks for reading and any help is greatly appreciated. Let me explain what's perplexing me...

    I'm planning on replacing all the 'text-areas' of my web-pages with a "Java script text-scroller", the main advantage and reason I'm using the code being that it has a scrollbar and customizable up/down buttons.
    I have aligned the content, up button, down button, and scrollbar by positioning them using an amount of pixels from the 'top' and 'left' of the window. This was fine when I used absolute DIV's to align everything on the page (all the images and text), but I've started aligning everything with centered-tables now as to avoid changing resolution problems, yet I can't seem to align/center the scroller along with my tables (containing images) when the window changes size.
    The source code to my particular problem can be found here on this test page I have up with the JavaScript scroller code in full.

    I really don't know if I should be using tables/changing the js code/ or using frames to fix the problem. I've been using stopgaps now for weeks simply because I can't get around it, and am in the middle of re-designing my site and want to sort this out once and for all.

    All ideas, suggestions, criticisms or a plain "what you're asking can't be done" would be really appreciated.
    Thanks for your time and help, take care.
    -Ant

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Advise 1 next time you try and write an url in a forum or anywhere else for that matter load the page of the url 1st and cut and paste from the browsers address bar would have saved u the faulty link.

    real link:http://www.geocities.com/belljar_band/help.htm


    I looked your code over, I never got the scroller to actually scroll lol :P


    anyway

    1. <style> tags in general goes in the head,IMO.

    2. Javascripts that do not produce content on document load goes in the head to, IMO.

    3. Tables are build <table><tr><td></td></tr></table>, with optional numbers of td's in a tr and tr's in a table.

    4. Spans ain't div's, div's are div's.

    5. I suggest u put the bg pic as the table background and then put put the scrollarea in that table. remember to put a position:relative in the incapsulating table.(position:absolute) is in aspect to the 1st parent with a defined position)(in IE at least).

    6. try and group style declarations. make them easier to read, and each group written with declarations in most important---least important. IMO.
    Position group.(Position,Top,Left,Width,Height,Z-index)
    Looks group.(Colors,Borders,Visibility)
    Ur style:
    Code:
    style="Z-INDEX: 4; LEFT: 635px; VISIBILITY: visible; WIDTH: 12px; POSITION: absolute; TOP: 15px; HEIGHT: 35px"
    how I would write it:
    Code:
    style="POSITION: absolute;TOP: 15px;LEFT: 635px; WIDTH: 12px;   HEIGHT: 35px;Z-INDEX: 4; VISIBILITY: visible; "
    Last edited by Garadon; 02-11-2004 at 09:32 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •