简体   繁体   English

IE6具有简单的切换功能

[英]Simple toggle function with IE6

I'm facing a problem with IE6. 我正面临着IE6的问题。

I took the toggle function from this website but when I apply it to my page I get the error (only in IE6): 我从这个网站上获取了切换功能,但当我将它应用到我的页面时,我收到错误(仅在IE6中):

Could not get the display property. 无法获取显示属性。 Invalid argument. 无效的论点。

I can get the display property, but the error is thrown when I want to set to the new value. 我可以获取display属性,但是当我想设置为新值时会抛出错误。

EDIT: I know that several developers have faced this problem. 编辑:我知道有几个开发人员遇到过这个问题。 So if it can help: the table-row property is not managed by internet explorer 6 ! 因此,如果它可以帮助: 表行属性不由Internet Explorer 6管理

In my case, even when I set the display property to '' I wasn't seeing anything but it was because I applied a class to my element that hide them on load, so the default display would be, hide and when you set the display property to '' IE set it to the default display. 在我的情况下,即使我将display属性设置为''我没有看到任何东西,但这是因为我将一个类应用于我的元素,在加载时隐藏它们,所以默认显示是,隐藏,当你设置显示属性为''IE将其设置为默认显示。

Are you trying to set the display-property to "table-row" by any change? 您是否尝试通过任何更改将display-property设置为“table-row”? That is not supported by IE6. IE6不支持这一点。

A tip is to set display to an empty string. 提示是将显示设置为空字符串。 It makes the browser use the default value for the element. 它使浏览器使用元素的默认值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM