473,621 Members | 2,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mozilla vertical sizing of dynamic content bug?

Greetings,

I'm attempting to create a tabbed box with CSS and Javascript and am having
some problems. I have three tabs and three tab content areas. When the page
is loaded, two of the three content areas are set to "display:none;" . When a
user clicks a tab, I call a function that changes the display style of the
appropriate tab page to "display:block; ". This is fine, as the correct block
is displayed.

The problem lies with Mozilla. Many times when switching the displayed div,
the sizing (vertical) is messed up. Instead of showing the div to fit the
current text, it is much longer, as though it would fit the current text and
the previous text that was displaying. This creates a huge whitespace at the
bottom of my div. I do not see this problem with IE 6 nor Opera 7.

The switching code is below:

<script type="text/javascript">
<!--
var oldTab;
var oldTabPage;

function showTabPage(tab Page, tab)
{

// Hide the old tab page
if ( oldTabPage == null )
oldTabPage = document.getEle mentById('tabpa ge1');

oldTabPage.styl e.display = 'none';

// Display the new tab page
var currentTabPage = document.getEle mentById(tabPag e);

currentTabPage. style.display = 'block';

oldTabPage = currentTabPage;

// Get the current tab for styling
var currentTab = document.getEle mentById(tab);

if ( oldTab == null )
oldTab = document.getEle mentById('tab1' );

oldTab = currentTab;
}
-->
</script>

There's nothing very special about the code. I have zipped up a small
example that can be downloaded here:
http://brian.vallelunga.com/files/tabbox.zip (4K)

Can someone suggest a solution? Is there someway to have Mozilla recalculate
the height at the end of the function? Any other suggestions? I have already
tried comp.lang.javas cript without success, and thus I am now here. I have
not found any other references to this problem on Google either.

Thanks,

Brian


Jul 20 '05 #1
2 2506
In <bp**********@b ob.news.rcn.net > "Brian Vallelunga" <bg**********@s tarpower.net> writes:
I'm attempting to create a tabbed box with CSS and Javascript and am having
some problems. I have three tabs and three tab content areas. When the page
is loaded, two of the three content areas are set to "display:none;" . When a
user clicks a tab, I call a function that changes the display style of the
appropriate tab page to "display:block; ".
Wretched. This makes your site accessible only to a select set of
browsers.

Can someone suggest a solution?


Have different pages for each tab.

--Dan
--
FREE scripts that make web and database programming easier
http://www.analysisandsolutions.com/software/
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
Jul 20 '05 #2
This isn't wretched, nor is it that limiting. This isn't being used as the
main navigation for a site, but rather as a sidebar within one page. The
content of each tab would be only a paragraph or a small list of links.

And as for browser support... This will work on most everything post
Netscape 4.x. My problem lies with Mozilla's vertical sizing when changing
tabs. This is the answer I need some help with.

Brian
"Analysis&Solut ions" <in**@analysisa ndsolutions.com > wrote in message
news:bp******** **@reader2.pani x.com...
In <bp**********@b ob.news.rcn.net > "Brian Vallelunga" <bg**********@s tarpower.net> writes:
I'm attempting to create a tabbed box with CSS and Javascript and am havingsome problems. I have three tabs and three tab content areas. When the pageis loaded, two of the three content areas are set to "display:none;" . When auser clicks a tab, I call a function that changes the display style of theappropriate tab page to "display:block; ".


Wretched. This makes your site accessible only to a select set of
browsers.

Can someone suggest a solution?


Have different pages for each tab.

--Dan
--
FREE scripts that make web and database programming easier
http://www.analysisandsolutions.com/software/
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3404
by: Jason Bassford | last post by:
Okay, What I'm trying to do is create two boxes, one on top of the other. The first is a static height, the 2nd, underneath it, should take up the remaining amount of screen space and overflow with its own vertical scrollbar for any extra content. I've managed to come up with this, which works perfectly in Mozilla, but fails in IE:
4
3452
by: Robert Secon | last post by:
Hi there, when using IE5+ my style sheets just work fine, but Mozilla does not agree with it and I can´t figure out which mistake it is. Usually the thing about it is that every row is displayed well but Mozilla displays the first row too big and cuts away the second row of the text. Can somebody tell me what is wrong with it and how to change the code? (HTML-Table wrapped around in php-code)
1
1796
by: J.Storta | last post by:
Prior to using style sheets, I used tables to lay out my pages. I always used percentages when specifying widths so that the page would fit nicely in the browsers regardless of the size of the window. Now that I have started to use style sheets for layout purposes, I am faced with some odd results when I try to create pages that are resizable. I end up with boxes that jump down underneath other elements if the window is resized too...
1
5626
by: delerious | last post by:
Could someone please take a look at this page: http://home.comcast.net/~delerious1/index11.html The set of links on the left should not have any whitespace between them, and the set of links on the right should have one pixel of whitespace between them. That's how it looks in IE and Opera. But in Mozilla, a few of the links on the left have whitespace between them, and some of the links on the right don't have whitespace between them...
1
23193
by: Marek Mänd | last post by:
<select multiple style="height:200px;"> <option>a <option>b </select> Why does Mozilla draw the vertical scrollbar to the SELECT html element? There is plenty of void room below two OPTIONs in the SELECT box, so there is no need for that. How do i get the overflow:auto like thing working in mozilla based
27
2296
by: dip | last post by:
pardon the coversational manner of my thread subject. i'm having issues with the way that the two browsers handle CSS. this is an element i've defined in my style sheet. =========== sm { font: 10px arial; color: #53278F; }
0
1423
by: BACON | last post by:
I'm just starting the process of reorganising my modest little website and cleaning up all the HTML, and the logical place to begin was with the homepage. I made a simple little ASP.NET control that I can drop into the beginning of any page and it will generate HTML to display my logo, a link, and (optionally) a quote of the day, all of which will be horizontally centered at the top of the page by my default stylesheet. For the main page,...
5
5798
by: BACON | last post by:
I'm just starting the process of reorganising my modest little website and cleaning up all the HTML, and the logical place to begin was with the homepage. I made a simple little ASP.NET control that I can drop into the beginning of any page and it will generate HTML to display my logo, a link, and (optionally) a quote of the day, all of which will be horizontally centered at the top of the page by my default stylesheet. For the main page,...
0
8156
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8653
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8457
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7127
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6101
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2587
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1460
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.