Any Java Script/CSS Experts?

Discussion in 'Web Design and Development' started by nokiauk, Feb 22, 2008.

  1. nokiauk macrumors member

    Joined:
    Apr 14, 2005
    Location:
    Scotland
    #1
    I have designed a menu for a website which uses JavaScript and CSS, the problem I seem to have is locating it on the page correctly.

    As per the attached screenshots it appears to change it position on the screen for some reason, at home on Safari it's offset right and behind, Windows at home is perfect, but Windows at work it's offset right again.

    Can't work out why. All menu code etc. is attached if anyone can help.

    Thanks.
     

    Attached Files:

  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Can you also attach the HTML? The CSS and JavaScript don't make much sense without it.
     
  3. nokiauk thread starter macrumors member

    Joined:
    Apr 14, 2005
    Location:
    Scotland
    #3
    Thanks for the reply, HTML for front page etc is not in the attached zip file.
     

    Attached Files:

  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    There's a lot of inline CSS in that HTML, and is where the problem is. For instance, the home item has the following inline CSS,
    Code:
    style="position: absolute; top: 115px; left: 375px; width: 100px; height: 24px; visibility: visible; z-index: 0; cursor: pointer;"
    The left being set to 375px is what is pushing the menu off to the right. The other menu items are positioned the same way. It probably looks right on some browsers because you have the window set a certain dimensions that allow this design to fit. With the items being positioned absolutely it's going to make it look bad on most browsers.

    The CSS should be in a style tag or a separate CSS file rather than being inline. That's the big reason for using CSS. I think the JavaScript is OK though.

    * Doh, just noticed this was created with iWeb, which explains some things, and you won't likely be able to adjust the CSS. I don't use iWeb so don't think I can help further. Maybe someone else here has familiarity with integrating the JavaScript menu, or can give guidance on how to make sure iWeb doesn't use such absolute positioning.
     
  5. nokiauk thread starter macrumors member

    Joined:
    Apr 14, 2005
    Location:
    Scotland
    #5
    thanks for the help, I have no clue really about CSS or Java

    think i'll leave out the menu and revert to standard html.
     
  6. John.B macrumors 601

    John.B

    Joined:
    Jan 15, 2008
    Location:
    Holocene Epoch
    #6
    Well, to be fair to the iWeb team, CSS isn't exactly a standar..., uh, er, um, nevermind. ;)
     

Share This Page