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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netscape + inline

Status
Not open for further replies.

vlitim

Programmer
Sep 2, 2000
393
GB
I have a iframe that I am either hiding or showing, works fine in IE but in netscape(7.2) it show fine but doesn't hide the <tr> properly, and then when you expand it again it add again to the open <tr>. very confused. please help.

Code:
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="darkbg">
<table border=0 cellpadding="3" cellspacing="1" width="100%">
<tr class="medbg">
<td height=16 id=forumsImg class="clsPartRightHidden"  onclick="visibilityToggle('forums','forumsImg','viewforums','messageBoard.asp?subscribed=1&popup=1')">
<b>Subscribed Themes</b> <span class=smallertext> (Subscribe to receive posts in full only)</span></td></tr>
<tr id="forums"  style="display:none"><td bgcolor="#ffffff" width="100%"><iFRAME name=viewforums frameborder=0  scrolling=auto marginheight=0 marginwidth=1 width="100%" height=150 src="/blank.asp"></iFRAME></td></tr>
</table></td></tr></table>


function visibilityToggle(id,getImg,framename,url,color,close) 
{
	var winLoc = window.frames[framename].location
	winLoc = new String(winLoc)

	var el = document.getElementById(id).style; 
	var img = document.getElementById(getImg);

	if (close == 0)
	{
			if (url.search(/winLoc/i)==-1)
			{
				window.frames[framename].location.href=url
			}
			el.display = "inline";
			img.className = 'clsPartRight'
	}
	else
	{
		if (el.display == "none")
		{ 
			if (url.search(/winLoc/i)==-1)
			{
				window.frames[framename].location.href=url
			}
			el.display = "inline";
			img.className = 'clsPartRight'
		} 
		else if(el.display == "inline")
		{ 
			el.display = "none";
			img.className = 'clsPartRightHidden'
		}
	}
}
 
right the problem seems to be with the fact that I am trying to show/hide a <tr> if I add div tags then I can get it working. The problem with this is that you can see the table cell, which I need to ne hidden!!!!! WHY?

Code:
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="darkbg">
<table border=0 cellpadding="3" cellspacing="1" width="100%">
<tr class="medbg">
<td width="100%" height=16 id=forumssImg class="clsPartRightHidden"  onclick="visibilityToggle('forumss','forumssImg','viewforumss','messageBoard.asp?subscribed=1&popup=1')">
<b>Subscribed Themes</b> <span class=smallertext> (Subscribe to receive posts in full only)</span></td></tr>
<tr><td height="0" bgcolor="#ffffff" width="100%"><div  id="forumss" style="display:inline"><iFRAME name=viewforumss frameborder=0  scrolling=auto marginheight=0 marginwidth=1 width="100%" height=150 src="/blank.asp"></iFRAME></div></td></tr>
</table></td></tr></table>
 
I would gather there is something wrong with you telling browser to display tr inline. <tr> is by default displayed as table-row (ie. display: table-row;). IE is very forgiving in this and its inline elements have many features of other elements, while Geckos (FF, Mozilla, NN) are much more strict in their interpretation and will not allow for an element table-cell to reside inside inline element. Hope it helps.
 
cheers for that I had no idea that there was even a thing called "table-row". Thats why you have to love IE, even if you don't code correctly it works!!
 
Actually, that is why I hate IE. Because it helps people get away with bad and incorrect code.
 
According to MS own web site you should not be able to hide and show a table row. But then they go on to say that, for compatibility issues with Excel, it can be done. Typical MS.

I don't know why in the world anyone thought it would NOT be a good idea to hide and show table rows. Seems to me the most natural and useful thing.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top