<element>.style.display = none; shows no effect on opera 4 mac

Forums » Dev.Opera » General Web Development Discussions

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

5. September 2008, 09:04:06

xmarvelous

Posts: 9

<element>.style.display = none; shows no effect on opera 4 mac

hi!

i wrote an opera widget lately. for switching between different views i'm using <element>.style.display = none/block; with some div-layers. on windows machines that works seamless but on macs its a bit problematic. the strange thing is that sometimes it works and sometimes it doesn't hide the the background layer and just overlays the new layer over the other. i think that is very strange since the layers are not absolute positioned and should be among each other if the display command would fail. could this be a bug in the browser? feels like some kind of race condition.

i recognised the same issue on linux machines too.

one more thing to mention is that the layers are using the opacity style option. they are slightly transparent.

regards, marv

19. October 2008, 10:21:49

nguunguyen

Posts: 2

That is too in opera mobile 9.5 beta

27. March 2009, 08:58:44

This feature does not work on Opera Mobile 8.65 and on Opera Mobile 9.51 Beta (Build 2723) on Windows Mobile 6 Professional as well. In order to easily check this wrong behaviour you could use the following code:

<!DOCTYPE html>
<html>
<head>
<title>Test style.display</title>
<script type="text/javascript">
function handleDockedMode()
{
document.getElementById("widget").style.display = "none";
document.getElementById("docked").style.display = "block";
}
</script>
</head>
<body onload="javascript:handleDockedMode();">
<div id="container">
<div id="widget">This text should be hidden.</div>
<div id="docked">This text should be visible.</div>
</div>
</body>
</html>

The same code is online at:

http://webcab.de/test/test.style.display.html

9. July 2009, 02:32:14

vector090

Posts: 1

well, I tried <div style='display:none'> and it does not work either, but later I wrote a separate css segment to define its class, and it works! sample code below:


<style type='text/css' media='handheld'>
.detail { display:none; }
</style>
<script type='text/javascript'>
function display(id)
{
document.getElementById(id).style.display="block";
}
</script>

title
<a href='javascript:display("zz")'>Detail</a>
<span id='zz' class='detail'>content here content here</span>

12. June 2010, 15:19:58

ramsaivibhav

Posts: 1

sir,
i have install operamini 3 but i have not display as like computer

Forums » Dev.Opera » General Web Development Discussions