Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nokiauk

macrumors member
Original poster
Apr 14, 2005
60
1
Scotland
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.
 

Attachments

  • Menu.zip
    2.9 KB · Views: 91
  • Windows-Work.jpg
    Windows-Work.jpg
    77.2 KB · Views: 112
  • Windows-Home.jpg
    Windows-Home.jpg
    165.6 KB · Views: 91
  • Safari-Home.jpg
    Safari-Home.jpg
    143.1 KB · Views: 78
Can you also attach the HTML? The CSS and JavaScript don't make much sense without it.
 
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.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.