Menu Align Center Help Please
Menu Align Center Help Please
I have used the command:
screenposition="center";
This works 'sometimes' in NS 7 and IE 6+ & Mozilla but sometimes the menu does not align correctly to the center until I do something like, minimise and maximise the window or operate any link in the menu (it skews off to the right by about 40 pixels)
I have no offsets in my script and have tried the 'align' command, 'menualign' and even wrapped by HTML <SCRIPT> Calls with a <CENTRE> Tag.
Has anyone seen this and what is the fix?
Thanks!
screenposition="center";
This works 'sometimes' in NS 7 and IE 6+ & Mozilla but sometimes the menu does not align correctly to the center until I do something like, minimise and maximise the window or operate any link in the menu (it skews off to the right by about 40 pixels)
I have no offsets in my script and have tried the 'align' command, 'menualign' and even wrapped by HTML <SCRIPT> Calls with a <CENTRE> Tag.
Has anyone seen this and what is the fix?
Thanks!
Understood, sketches, and your thoughtfulness is most appreciated.
Unfortunately, I haven't seen your message, and I'm sure it got caught by the spam traps here at the university.
Next thought would be to post your code here (use the [code][/code] tags). Just the _data file and your JS menu calls, with a little of the surrounding HTML should get us going.
Thanks.
Unfortunately, I haven't seen your message, and I'm sure it got caught by the spam traps here at the university.
Next thought would be to post your code here (use the [code][/code] tags). Just the _data file and your JS menu calls, with a little of the surrounding HTML should get us going.
Thanks.
John
URL
Sorry, I did not know where to start so here is a URL (I'll edit and delete this post once you have noted it)
http://deleted_too_adult/personals/test.htm
milonic is loaded into the same directory
As a sanity test I removed the menu script fron outside of my PHP software scritpt and just put it into the HTM page above - same problem
(I was building it into http://deleted_too_adult/personals/main.php )
Here is the bit in the code:
Thanks for your thoughts
Martin
http://deleted_too_adult/personals/test.htm
milonic is loaded into the same directory
As a sanity test I removed the menu script fron outside of my PHP software scritpt and just put it into the HTM page above - same problem
(I was building it into http://deleted_too_adult/personals/main.php )
Here is the bit in the code:
Code: Select all
with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=5;
screenposition="center";
menualign="center";
align="center";
alwaysvisible=1;
orientation="horizontal";
Martin
Last edited by sketches on Tue Apr 13, 2004 7:31 pm, edited 1 time in total.
css
Thanks Ruth
As you can see from the URL above (test.htm) I have stripped it back to the bare bones with no css sheet - still same problem that it does not center on first load and I have to minimise/maximise window to do it.
I have Win 2000 Professional running from a laptop running an ATI Radion 7500 video card (not sure how this java magic works but I guess the video hardware might come into it)
I asked a friend to check it on Win 98 using an MX Pro Video Card and same problem.
As you can see from the URL above (test.htm) I have stripped it back to the bare bones with no css sheet - still same problem that it does not center on first load and I have to minimise/maximise window to do it.
I have Win 2000 Professional running from a laptop running an ATI Radion 7500 video card (not sure how this java magic works but I guess the video hardware might come into it)
I asked a friend to check it on Win 98 using an MX Pro Video Card and same problem.
One useful observation
This may help milonic team as I have a slow modem and can see this thing unfold in lovely slow motion
on test.htm (URL above) The dark purple menu background (border) I have selected centers perfectly, but it does not take account of the total size of the images I am loading (the background appears smaller than the final loaded pixel width total of the images).
So when each images loads from left to right, the menu extends out to the right to fit all of the images in.
It only re-centers after I minimise/maximise the page or do a menu action (as the images are now in my cache)
Useful?
Is there a command that allows me to set the pixel width of the border?
PS The test page is optimised for 1024 x 768 but will just squeeze into an 800 x 600 screen
on test.htm (URL above) The dark purple menu background (border) I have selected centers perfectly, but it does not take account of the total size of the images I am loading (the background appears smaller than the final loaded pixel width total of the images).
So when each images loads from left to right, the menu extends out to the right to fit all of the images in.
It only re-centers after I minimise/maximise the page or do a menu action (as the images are now in my cache)
Useful?
Is there a command that allows me to set the pixel width of the border?
PS The test page is optimised for 1024 x 768 but will just squeeze into an 800 x 600 screen
It sounds like you've identified the problem. The menu is rendered before the browser is finished loading the images. The browser doesn't know the width of an image if it hasn't loaded it, so it'll just use a default width (or a specified width) as a place holder. Are you noticing that the images are clipped when they finally do show up? In thus case, a reload would almost certainly re-center the menu properly. So, what to do? Two possibilities:
(1) First, I'd try this. Specify the width of wach image in the aI() string, so that the browser will know what width to use, even if the image isn't yet available. I.e., instead of
add the imagewidth property, like so
substituting your actual image width, of course. Measurement is in px. Do that for each of your main menu items.
(2) If that doesn't work, then you could write s small funciton to cache the necessary images before running the menu code, so that they are available when the menu renders. Try #1 first, and see if that fixes it before we have a go at #2.
Kevin
(1) First, I'd try this. Specify the width of wach image in the aI() string, so that the browser will know what width to use, even if the image isn't yet available. I.e., instead of
Code: Select all
aI("url=whatever.htm;image=imageName.gif;");
Code: Select all
aI("url=ehatever.htm;image=imageName.gif;imagewidth=130;");
(2) If that doesn't work, then you could write s small funciton to cache the necessary images before running the menu code, so that they are available when the menu renders. Try #1 first, and see if that fixes it before we have a go at #2.
Kevin
Thanks - That 99% did it!
Thank you for your suggestion - it did the trick with a minor addition
I had to add the imageheight property also:
otherwise the script seems to try to guess the height of the first image and baloons the menu out in height for a few seconds whilst it sorts itself out (impressive but rather odd looking effect )
adding imageheight keeps the wild horse under control.
Thank you all for your help. Very much appreciated and glad to see this code is very flexible.
I had to add the imageheight property also:
Code: Select all
imagewidth=105;imageheight=28;
adding imageheight keeps the wild horse under control.
Thank you all for your help. Very much appreciated and glad to see this code is very flexible.