Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick and easy problem - expanding menu

Status
Not open for further replies.

Mavrix

Technical User
Apr 12, 2000
8
0
0
GB
Hi - I've got this neat bit of code (below) that works fine in Internet Explorer, but not in Netscape - but it seems that it could be quickly fixed.<br><br>Could anyone please help me out by tweaking it to have it work in Netscape - that'd be great.<br><br>------<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;title&gt;Untitled Document&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;p&gt;&lt;font size=&quot;2&quot;&gt;&lt;a href=&quot;#&quot; style=&quot;cursor: hand&quot; onClick=&quot;document.all.section1.style.display=document.all.section1.style.display=='none' ? '' <br>: 'none'&quot; onMouseOver=&quot;window.status='Section 1'; return true;&quot; onMouseOut=&quot;window.status='Select an item from the menu'; return <br>true;&quot;&gt;&lt;b&gt;Section 1&lt;/b&gt;&lt;/a&gt;&lt;br&gt;&lt;/font&gt;&lt;/p&gt;<br>&lt;p id=section1 style=&quot;display:none&quot;&gt;&lt;font size=&quot;2&quot;&gt;Item 1&lt;br&gt;<br>&nbsp;&nbsp;Item 2&lt;br&gt;<br>&nbsp;&nbsp;Item 3&lt;br&gt;<br>&nbsp;&nbsp;&lt;/font&gt;&lt;/p&gt;<br><br>&lt;p&gt;&lt;font size=&quot;2&quot;&gt;&lt;a href=&quot;#&quot; style=&quot;cursor: hand&quot; onClick=&quot;document.all.section2.style.display=document.all.section2.style.display=='none' ? '' <br>: 'none'&quot; onMouseOver=&quot;window.status='Section 2'; return true;&quot; onMouseOut=&quot;window.status='Select an item from the menu'; return <br>true;&quot;&gt;&lt;b&gt;Section 2&lt;/b&gt;&lt;/a&gt;&lt;br&gt;&lt;/font&gt;&lt;/p&gt;<br>&lt;p id=section2 style=&quot;display:none&quot;&gt;&lt;font size=&quot;2&quot;&gt;Item 1&lt;br&gt;<br>&nbsp;&nbsp;Item 2&lt;br&gt;<br>&nbsp;&nbsp;Item 3&lt;br&gt;<br>&nbsp;&nbsp;&lt;/font&gt;&lt;/p&gt;<br><br>&lt;/body&gt;<br>&lt;/html&gt;<br>----------<br>
 
Dear Mavrix,<br><br>Netscape does not support the CSS.display attribute.<br>Netscape does not support the 'All' object in it's DOM.<br><br>The code cannot be 'tweaked' to make it work in both browsers. The onclick events need to call client script functions that perform browser detection to access the DOM element in the appropriate fashion depending on the browser. There are good samples of this all over the NET.<br><br>Check out CNET builder.com <A HREF=" TARGET="_new"> luck<br>-pete
 
Hey Pete- you have a copy of Netscape's DOM support, by any chance? I need to find a DOM tree for both browsers, and Netscape is the more pressing one at the moment... <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
thanks for the links... <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top