菜单问题 [英] Menu Issues

查看:109
本文介绍了菜单问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试进行一些更新并超越挫折而使其成为

兼容Mac'我主要完成。我现在遇到的最大问题

是Opera没有显示菜单。在IE,NS和Firefox中工作得很好。

由于必须让它以iframe为目标进行更新而不得不使用

编写我自己的菜单。不要出现任何错误,根本不会显示。

菜单代码和css文件如下。 html文件的位置是:
http://www.otts.com /index_beta.html

展开 | 选择 | Wrap | 行号

解决方案

Matthew Hagston写道:< blockquote class =post_quotes>尝试进行一些更新并超越挫折,使其与Mac兼容,我主要完成了。我现在遇到的最大问题


[snip] ceDiv.setAttribute(" id",divMaster);




你对了,中心部分在Safari中不起作用。我得到了上面一行

,这应该是:


ceDiv.setAttribute(" id"," divMaster");


注意额外的双引号。


弗雷德。


周三,27日2004年10月19:21:16 +1000,Fred Oz< oz **** @ iinet.net.auau>写道:

Matthew Hagston写道:

ceDiv.setAttribute(" id",divMaster);
你是对,中心部分在Safari中不起作用。我得到的就像上面那行一样,应该是:

ceDiv.setAttribute(" id"," divMaster");




真的,它应该是:


ceDiv.id = divMaster;


(弗雷德注意:divMaster是一个带有值的变量''divMaster'')

应为XML文档保留setAttribute方法。 HTML

文档为方便起见给出了属性,因此请使用它们。我还要

相信IE有setAttribute的问题,虽然我不知道

细节。


来自原帖:

document.getElementById(" divMaster")。className = divMaster;
document.getElementById(" divMaster")。s​​tyle.top = 0 +''px'' ;
document.getElementById(" divMaster")。s​​tyle.left = 0 +''px'';
document.getElementById(" divMaster")。s​​tyle.height = 22 +''px '';




这些也可以更好地写成:


ceDiv.className = divMaster;

ceDiv.style.top =''0px'';

ceDiv.style.left =''0px'';

ceDiv.style.height =' '22px'';


作为离别评论,我不敢说我​​觉得剧本很可怕。

没有特征检测,使用对象推理,没有优雅的可能性降价,在21世纪使用FONT,和一般效率低下。


迈克


-

Michael Winter

替换 ;。无效"与.uk通过电子邮件回复。


Michael Winter写道:

[snip]


( Fred的注意事项:divMaster是一个带有值的变量''divMaster'')


是的 - 我感到很困惑''因为我正在测试代码片段和OP

在变量divMaster和字符串divMaster之间切换。


我看不出变量名称与字符串相同的意义
它包含
- 但这不是我的错误的借口。此外,为什么使用这个

变量可能是三次,并且使用相同的字符串17次?


[snip]作为离别评论,我是不敢说我觉得剧本太可怕了。没有特征检测,物体推理的使用,优雅退化的可能性,21世纪FONT的使用,以及一般的低效率。




可以添加没有尝试隔离错误并提供一个简单的

简洁示例。


无论如何,我通过w3c HTML验证器运行页面。它由于MARQUEE标记而在第59行被触发了 - 它不是HTML

规范的一部分:


"任务:不要使用marquee元素创建滚动文本。


...


marquee元素不是HTML规范的一部分。如果你必须有滚动文本,请使用

@@ EcmaScript。


此外,在动态菜单上运行光标很快就会填满

console with"(事件处理程序):未定义的值" Safari中的错误。

干杯,弗雷德。


Trying to do some updating and beyond frustrations with making it
compatibal with Mac''s I am primarily done. Biggest problem I am having now
is with Opera not displaying the menu. works fine in IE, NS, and Firefox.
Due to the problem of having to have it target an iframe to update had to
write my own menu. Do not get any errors, simply will not display at all.
code of the menu and the css file is below. location of the html file is:
http://www.otts.com/index_beta.html

Expand|Select|Wrap|Line Numbers

解决方案

Matthew Hagston wrote:

Trying to do some updating and beyond frustrations with making it
compatibal with Mac''s I am primarily done. Biggest problem I am having now
[snip] ceDiv.setAttribute("id", divMaster);



You''re right, the centre part doesn''t work in Safari. I got as far as
the above line, which should be:

ceDiv.setAttribute("id", "divMaster");

Note extra set of double quotes.

Fred.


On Wed, 27 Oct 2004 19:21:16 +1000, Fred Oz <oz****@iinet.net.auau> wrote:

Matthew Hagston wrote:

ceDiv.setAttribute("id", divMaster);
You''re right, the centre part doesn''t work in Safari. I got as
far as the above line, which should be:

ceDiv.setAttribute("id", "divMaster");



Really, it should be:

ceDiv.id = divMaster;

(Note to Fred: divMaster is a variable with the value, ''divMaster'')

The setAttribute method should be reserved for XML documents. HTML
documents are given properties for convenience, so use them. I also
believe that IE has problems with setAttribute, though I don''t know the
specifics.

From the original post:
document.getElementById("divMaster").className = divMaster;
document.getElementById("divMaster").style.top = 0+''px'';
document.getElementById("divMaster").style.left = 0+''px'';
document.getElementById("divMaster").style.height = 22+''px'';



These would also be better written as:

ceDiv.className = divMaster;
ceDiv.style.top = ''0px'';
ceDiv.style.left = ''0px'';
ceDiv.style.height = ''22px'';

As a parting comment, I''m afraid to say I think that script is horrific.
No feature detection, use of object inference, no possibility of graceful
degradation, the use of FONT in the 21st century, and general inefficiency.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.


Michael Winter wrote:
[snip]


(Note to Fred: divMaster is a variable with the value, ''divMaster'')
Yup - I got confused ''cos I was testing code snippets and the OP
switched between the variable divMaster and the string "divMaster".

I can''t see the point of making a variable name identical to the string
it contains - but that''s no excuse for my error. Further, why use this
variable maybe three times, and use the identical string 17 times?

[snip] As a parting comment, I''m afraid to say I think that script is
horrific. No feature detection, use of object inference, no possibility
of graceful degradation, the use of FONT in the 21st century, and
general inefficiency.



To which could be added no attempt to isolate the errors and present a
concise example.

Anyhow, I ran the page through the w3c HTML validator. It barfed at
line 69 because of the MARQUEE tag - it is not part of the HTML
specification:

"Task: Do not create scrolling text with the marquee element.

...

The marquee element is not part of the HTML specification. Use
@@EcmaScript if you must have scrolling text."

Also, running a cursor over the dynamic menus pretty quickly fills the
console with "(event handler):Undefined value" errors in Safari.
Cheers, Fred.


这篇关于菜单问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆