当页面符合W3标准时,Java按钮在Firefox中不起作用

时间:2011-05-17 22:12:18

标签: javascript firefox w3c

我有一些菜单按钮,当我声明一个DocType页面(Trans或Strict)时,Button停止在Firefox中工作,但在IE中工作。如果我将页面声明为<HTML>,则按钮可以正常工作。

使用JS文件的HTML代码如下,不确定您是否需要查看JS代码,因为这是问题的HTML(我认为)

<a href="http://dukescottages.com/" onmouseover="setOverImg('1','');overSub=true;showSubMenu('submenu1','button1');" onmouseout="setOutImg('1','');overSub=false;setTimeout('hideSubMenu(\'submenu1\')',delay);" target=""><img src="buttons/button1up.png" border="0" id="button1" vspace="0" hspace="0"></a><a href="Link 2" onmouseover="setOverImg('2','');overSub=true;showSubMenu('submenu2','button2');" onmouseout="setOutImg('2','');overSub=false;setTimeout('hideSubMenu(\'submenu2\')',delay);" target=""><img src="buttons/button2up.png" border="0" id="button2" vspace="0" hspace="0"></a><a href="http://dukescottages.com/prettyphoto.htm" onmouseover="setOverImg('3','');overSub=true;showSubMenu('submenu3','button3');" onmouseout="setOutImg('3','');overSub=false;setTimeout('hideSubMenu(\'submenu3\')',delay);" target=""><img src="buttons/button3up.png" border="0" id="button3" vspace="0" hspace="0"></a><a href="http://dukescottages.com/Guestbook/ddgb.php" onmouseover="setOverImg('4','');overSub=true;showSubMenu('submenu4','button4');" onmouseout="setOutImg('4','');overSub=false;setTimeout('hideSubMenu(\'submenu4\')',delay);" target=""><img src="buttons/button4up.png" border="0" id="button4" vspace="0" hspace="0"></a><a href="http://dukescottages.com/contactform.htm" onmouseover="setOverImg('5','');overSub=true;showSubMenu('submenu5','button5');" onmouseout="setOutImg('5','');overSub=false;setTimeout('hideSubMenu(\'submenu5\')',delay);" target=""><img src="buttons/button5up.png" border="0" id="button5" vspace="0" hspace="0"></a><a href="*" onmouseover="setOverImg('6','');overSub=true;showSubMenu('submenu6','button6');" onmouseout="setOutImg('6','');overSub=false;setTimeout('hideSubMenu(\'submenu6\')',delay);" target=""><img src="buttons/button6up.png" border="0" id="button6" vspace="0" hspace="0"></a>

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

这是猜测,但也许Firefox希望您在严格模式下关闭这些<img>标签。

使用<img src="buttons/button1up.png" border="0" id="button1" vspace="0" hspace="0"></img>关闭它们,或者如果是XHTML,则<img src="buttons/button1up.png" border="0" id="button1" vspace="0" hspace="0" />

关闭它们