By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,677 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,677 IT Pros & Developers. It's quick & easy.

Weird dynamic table rendering in Opera

P: n/a
Ok, I'm building a JS-based limitless-sublevel dynamic menu and am
making it cross browser as well - 3 packs of aspirin so far and
counting ;)

I'm having a weird rendering problem using Opera 7.51, even though it
displays fine in Mozilla 1.6, Firefox 0.9, Netscape 7.1 and Internet
Explorer 6.0

Hope someone can help!

In the HTML page ...

<table id="table_submenu1" border="0" cellspacing="0" cellpadding="0"
style="Border: 1px solid #7E92A6; Position: absolute; Left: 0px; Top:
0px; Display: none;">
<tr>
<td>FLIBBLE</td>
</tr>
</table>

In the JS include ...

function showSubMenu( oMenu )
{
// Hide all menus below this one
var iMenuLevel = getMenuLevel( oMenu.id );
hideAllMenusBelowLevel( iMenuLevel );

// Break out if no sub-menu available
if ( !hasSubMenu(oMenu.id) )
return false;

// Set up variables
var aThisMenuItems = getSubMenuItems( oMenu.id );
var iThisLeft = bNetscapeBased ? getLeft( oMenu ) +
iNetscapeXOffset : getLeft( oMenu );
var iThisTop = bNetscapeBased ? getTop( oMenu ) +
iNetscapeYOffset : getTop( oMenu );
var iThisHeight = oMenu.offsetHeight;
var iThisWidth = oMenu.offsetWidth;
var oSubMenuTable = eval( 'oTableSubmenu' + iMenuLevel );
var oSubMenuTbody = oSubMenuTable.getElementsByTagName( 'TBODY'
)[0];

// Clear the table
while ( oSubMenuTbody.hasChildNodes() )
oSubMenuTbody.removeChild( oSubMenuTbody.childNodes[0] );

// Build the table
for ( var iRow = 0; iRow < aThisMenuItems.length; iRow++ )
{
// Make the objects
var oNewTR = document.createElement( 'TR' );
var oNewTD = document.createElement( 'TD' );
var oNewDIV = document.createElement( 'DIV' );
var oNewTEXT = document.createTextNode( aSubMenuItems[
aThisMenuItems[iRow] ][0] );

// Add attributes/events to the objects
oNewTD.style.padding = '0px'; // Needed for
Opera browsers
oNewDIV.className = 'menuitem';
if ( iRow > 0 )
oNewDIV.style.borderTop = '1px solid #7E92A6';

// Add objects to the table
oNewDIV.appendChild( oNewTEXT );
oNewTD.appendChild( oNewDIV );
oNewTR.appendChild( oNewTD );
oSubMenuTbody.appendChild( oNewTR );
}

// Show the table
with ( oTableSubmenu1.style )
{
display = 'block';

if ( iMenuLevel == 1 )
{
top = ( iThisTop + iThisHeight ) + 'px';
left = iThisLeft + 'px';
}
else
{
top = iThisTop + 'px';
left = ( iThisLeft + iThisWidth ) + 'px';
}
}
}

Ok, now THIS is the display in all the other browsers ...

http://freespace.virgin.net/martin.doyle1/rest.jpg

.... and THIS is how it displays in Opera

http://freespace.virgin.net/martin.doyle1/opera.jpg

It seems to be as if Opera is adding cellspacing to the table (if you
set the background color of the table it shows through, but not of the
cells) but I've explicitly turned it off and checked for it, and it's
not that. I also tried setting margin and padding of the tbody to
zero, but again no joy.

A sample site can be viewed at http://www.martindoyle.com/operasample
- while my PC is up and until this is solved anyway - so you can see
it in action.

Help desperately welcomed with open arms!!!
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
us********@martindoyle.com (Martin Doyle) wrote:
Ok, I'm building a JS-based limitless-sublevel dynamic menu and am
making it cross browser as well
No such thing since js is optional on the client side.
function showSubMenu( oMenu )
JS questions belong in a js group.
A sample site can be viewed at http://www.martindoyle.com/operasample
Congrats, you've managed to make it impossible for me to navigate your
site, SEs likewise.
Help desperately welcomed with open arms!!!


Stop doing silly things like using js for essential stuff like
navigation, use it for optional fluff only.

--
Spartanicus
Jul 20 '05 #2

P: n/a
Spartanicus <me@privacy.net> wrote in message news:<rm********************************@news.spar tanicus.utvinternet.ie>...
us********@martindoyle.com (Martin Doyle) wrote:
Ok, I'm building a JS-based limitless-sublevel dynamic menu and am
making it cross browser as well


No such thing since js is optional on the client side.


Cross-browser means for it to work the same in the different flavours
of browser. It does not mean it will work identically in every browser
regardless of the settings specified by that particular user.
function showSubMenu( oMenu )


JS questions belong in a js group.


And questions about the layout of objects in different browsers belong
in the CSS group.
A sample site can be viewed at http://www.martindoyle.com/operasample


Congrats, you've managed to make it impossible for me to navigate your
site, SEs likewise.


Good, quite frankly.
Help desperately welcomed with open arms!!!


Stop doing silly things like using js for essential stuff like
navigation, use it for optional fluff only.


Your entire post is a perfect example of the kind of unhelpful,
arrogant and frankly impolite behaviour afflicting so many public
newsgroups. Thankfully I have had much more helpful posts in other
forums so I now have the solution, but your utterly pointless reply
has served no purpose other than to show your lack of both patience
and manners, not to mention wasting your obviously valuable time.
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.