Re: Position layers works in IE not Firefox/Safari



cewisham@xxxxxxxxx wrote :
I have a menu that pops up different layers as you mouse over. Seems to
work OK in IE 6. I position the layers dynamically with javascript
because the menu moves when users resize their browser window. In the
Firefox or Safari browsers the position of the layers is 0,0 no matter
what, right off the bat. Top left corner.
Can any one tell me why?

The Magpie got it: you are passing the image name when you should be passing the id attribute if you use getElementById or the image name with document.images collection. You can't mix the 2.

What Randy told you is also correct and good. The first branch of a if..else..else block should be the W3C DOM support.

function positionLayer(layerID, imageName)
{
var xPos, yPos, myElement, myLayer;

if(document.images)
// DOM 2 HTML compliant
// http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-90379117
{
xpos = getXPos(document.images[imageName]);
yPos = getYPos(document.images[imageName]);
};
}

I suggest you drop the document.layers block unless you can test the function+DHTML menu with NS 4.x and if you know that there are still users using it... and even there, I'd never recommend using NS 4.x to reach a bank website. NS 4.x users represent less than 0.5% worldwide: it's definitely not worth the huge trouble coding for NS 4.x involves.

I'm going to add that your webpage is full of deprecated markup code, uses transitional DTD and is full of nested tables: there is no reason for all this.

Table-based webpage design versus CSS-based webpage design: resources
http://www.gtalbot.org/NvuSection/NvuWebDesignTips/TableVsCSSDesign.html

HTML Tidy extension for Firefox users
http://users.skynet.be/mgueury/mozilla/index.html

Why we won't help you
http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you

HTML markup validator
http://validator.w3.org/

Gérard
--
remove blah to email me
.



Relevant Pages

  • Re: Display HTML in Applicaton Window
    ... I want to be able to read a local HTML file and display it in a browser window within my application. ... I also want to submit that page to my application and generate a "Post" to a web server and read the contents back and display back into the same browser window in my application. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How do I create web pages so tables/frames NEVER resize, even
    ... relevant settings script should be or where to find a newbie-friendly ... But if you must, open the HTML ... they always get resized when I make the browser window smaller. ... Confirming that the tables are fixed widths and that the frames are not ...
    (microsoft.public.word.tables)
  • Re: .wmv and .asf files not found by WMP 11
    ... main page by dragging the file into an open web browser window. ... WMP started but the screen was blank and the word "DONE" was ... the pathname to all my web sites on my local computer. ... When I was first learning html ...
    (microsoft.public.windowsmedia.player)
  • Re: Need a non-"window.open" pop up window
    ... Use _blank as the target to open the page in a new browser window, ... is nothing in HTML that will let you control how the browser appears (ie: ... It messes with other javascript that I have on my page. ... totally HTML option would be ideal. ...
    (microsoft.public.frontpage.client)
  • Re: Newbie question: Formatting JSPs for different browser settings
    ... one of my users looked at the JSPs but with her Favorites/Links ... I guess you used HTML in your JSP page? ... Pages which adjust their sizes with the size of the browser window have ...
    (comp.lang.java.programmer)