Span inside span not working in Firefox but works in IE

Following code works in IE but not in Firefox. Its a simple functional

Page 1 of 1

3 Replies - 11992 Views - Last Post: 10 April 2008 - 03:46 PM

#1 hsc  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 08-April 08

Span inside span not working in Firefox but works in IE

Post icon  Posted 08 April 2008 - 03:12 AM

Following code works in IE but not in Firefox. Its a simple functionality. On mouse over sub menu should be displayed.

function toggle(id)
{
	if (elCurDisplay != null )
	{
		elCurDisplay.style.display = 'none';
	}
	el = document.getElementById(id);
	elCurDisplay = el; 
	var display = el.style.display ? '' : 'none';
	el.style.display = display;
}

<table>
	<span id='sp_main1' onmouseover="toggle('child1_1')"  onmouseout="hide('child1_1')"  >
	<tr>
		<td id="Main1" >
			
			<b>Main One</b>
			
		</td>
	</tr>	
	
	<tr >
		<td id="childmenu_1">
			<span id='child1_1' class='item' style="display:none">
			<table>
				<tr><td>
					Child 1
				</td></tr>
				<tr><td>
					Child 2
				</td></tr>
				<tr><td>
					Child 3
				</td></tr>
			</table>
			</span>
		</td>
	</tr>
	</span>
</table>



** edit ** :code:

This post has been edited by no2pencil: 09 April 2008 - 02:23 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Span inside span not working in Firefox but works in IE

#2 chrisman  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 46
  • Joined: 22-March 08

Re: Span inside span not working in Firefox but works in IE

Posted 08 April 2008 - 09:25 PM

Well, the funny thing about FireFox is that it doesn't work with ANY <span>s it flat-out doesn't support them. You could use <div>s here, couldn't you?
Was This Post Helpful? 0
  • +
  • -

#3 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5234
  • View blog
  • Posts: 27,024
  • Joined: 10-May 07

Re: Span inside span not working in Firefox but works in IE

Posted 09 April 2008 - 02:24 AM

Rather than nesting spans, why not put one span inside of a div?
Was This Post Helpful? 0
  • +
  • -

#4 JasonMcAuley  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 144
  • Joined: 10-April 08

Re: Span inside span not working in Firefox but works in IE

Posted 10 April 2008 - 03:46 PM

<div> layers are your friend here.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1