473,397 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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(tabPage, tab)
{

// Hide the old tab page
if ( oldTabPage == null )
oldTabPage = document.getElementById('tabpage1');

oldTabPage.style.display = 'none';

// Display the new tab page
var currentTabPage = document.getElementById(tabPage);

currentTabPage.style.display = 'block';

oldTabPage = currentTabPage;

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

if ( oldTab == null )
oldTab = document.getElementById('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.javascript 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 2497
In <bp**********@bob.news.rcn.net> "Brian Vallelunga" <bg**********@starpower.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&Solutions" <in**@analysisandsolutions.com> wrote in message
news:bp**********@reader2.panix.com...
In <bp**********@bob.news.rcn.net> "Brian Vallelunga" <bg**********@starpower.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
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...
4
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...
1
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...
1
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...
1
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...
27
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 {...
0
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...
5
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...
0
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...

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.