Forum Moderators: open
[opera.com...]
I also expect some interesting surprises when v.7 beta is released. I doubt if that event is more than a few months away. With the promised additional support of DOM, there will be even more to like about this incerdible piece of software.
I just gave up on trying to include Opera in my DHTML that uses the display property and had to lump it in with NN4s CSS and JavaScript.
I'd love to take Opera out of this code:
if (typeof document.getElementById!="undefined"&&typeof window.opera=="undefined") {
document.write('<\script src="scripts_DOM.js" type="text/javas\cript" language="Java\script"></s\cript>');
} else {
}
display:none works on page load but can't be (AFAIK) manipulated. Here is an example. This works in IE5+, NN6 (I don't know about ver 7) and Mozilla 1.0.
I really like Opera and use it or Mozilla 1.0. I'd like to see it compete with the big boys when it comes to DHTML.
<html>
<head>
<title>Expand</title>
<script language="JavaScript" type="text/javascript">
<!-- Hide script from older browsers
function toggle(Sub) {
if (document.getElementById) {
thisMenu = document.getElementById(Sub).style
if (thisMenu.display == "block") {
thisMenu.display = "none"
} else {
thisMenu.display = "block"
}
return false
} else {
return true
}
}
// End hiding script -->
</script>
<style>
.Subs {display: none;}
</style>
</head>
<body>
<a href="javascript:void(0);" onClick="return toggle('Sub1')">Heading 1</a><br>
<span class="Subs" ID="Sub1">
content
</span>
<a href="javascript:void(0);" onClick="return toggle('Sub2')">Heading 2</a><br>
<span class="Subs" ID="Sub2">
content
</span>
<a href="javascript:void(0);" onClick="return toggle('Sub3')">Heading 3</a>
<span class="Subs" ID="Sub3">
content
</span>
</body>
</html>