...

View Full Version : style.display in Opera



glenngv
08-26-2002, 09:52 AM
i've got div tags with display:none and with a click on a link, i change the display to empty. it doesn't work and when i alert(obj.style.display) just before i set it, the error says undefined. the variable obj is an object pointing to a div. i thought Opera doesn't support the display property but the fact that the div's are not displayed on load of the page with initial value 'none', it supports display property.

so how can i programmatically set the 'display' property in Opera? Im using Opera 6.05

glenngv
08-27-2002, 06:30 AM
anybody knows the solution?

joh6nn
08-27-2002, 07:14 AM
to the best of my knowledge, opera doesn't support display.

glenngv
08-27-2002, 07:24 AM
Originally posted by joh6nn
to the best of my knowledge, opera doesn't support display.

but why the div's are not displayed when display:none?
this means it recognized the property 'display'.

brothercake
08-27-2002, 10:04 AM
Opera does recognise display as an initial property, which is why it works, but you cannot modify its value after its been set

glenngv
08-27-2002, 10:14 AM
Originally posted by brothercake
Opera does recognise display as an initial property, which is why it works, but you cannot modify its value after its been set

even just reading its value?
well, if that's the case, Opera needs an operation :D
is it the same with visibility property?

mpjbrennan
08-27-2002, 10:51 AM
Opera has some unusual features, one of which is the ability to change how it identifies itself to the server. In the preferences menu you can set it to identify as Opera, as Mozilla or as Internet Explorer. If you choose the latter then it will happily implement document.all. If you choose the former two options it will not.

weird!

patrick

brothercake
08-27-2002, 03:21 PM
Originally posted by glenngv
is it the same with visibility property?


No, visibility works fine. Changing the identity setting won't affect whether this works or not - you should never use document.all for opera, because it only works in "MSIE" emulation mode - you can't control which mode the user has set, therefore always use the DOM methods for accessing objects.

Opera 7 is much better ... just have to wait for that

mpjbrennan
08-27-2002, 04:10 PM
you should never use document.all for opera, because it only works in "MSIE" emulation mode - you can't control which mode the user has set, therefore always use the DOM methods for accessing objects.


I agree brothercake, which is why I can't understand why they included this strange feature in Opera.

patrick

brothercake
08-27-2002, 04:46 PM
I think because many people, although not so much anymore, makes sniffer scripts that check for IE or Netscape and redirect all others to one of those stupid "please upgrade your browser" pages - the emulation gets round that, so that Opera is able to run the script anyway ... even though it may still not work correctly.

I agree it's counterproductive in the long run, but I sympathise with Opera for doing this, otherwise they may never have been able to acheive any kind of inroads



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum