473,509 Members | 2,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using display or visibility to implement tabs


it seems that we can actually use "display" or "visibility" to
implement tabs. i just wonder if there are pros and cons?

it seems that if we use "display", the browser may need to shrink the
1st tab first, and then redisplay the second and re-flow the things on
the screen, thus causing a time delay.

with visibility, there probably is not such delay...

so is this how you make the big tabs content div's:

<div id="tab1" style="height: 800px">
content 1
</div>

<div id="tab2" style="positive: relative; top: -800px">
content 2
</div>

tab3, tab4 the same way as tab2...

and then just use javascript to toggle the visibility.

thanks.

Oct 26 '07 #1
1 2308
On 2007-10-26, Summercool <Su************@gmail.comwrote:
>
it seems that we can actually use "display" or "visibility" to
implement tabs. i just wonder if there are pros and cons?

it seems that if we use "display", the browser may need to shrink the
1st tab first, and then redisplay the second and re-flow the things on
the screen, thus causing a time delay.
That sounds about right.
with visibility, there probably is not such delay...
Exactly, a visibility change will never move anything on the screen so
the browser can avoid a reflow.
so is this how you make the big tabs content div's:

<div id="tab1" style="height: 800px">
content 1
</div>

<div id="tab2" style="positive: relative; top: -800px">
content 2
</div>

tab3, tab4 the same way as tab2...

and then just use javascript to toggle the visibility.
Something broadly along those lines should be fine. Of course there's
no such property as positive: relative.
Oct 26 '07 #2

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

Similar topics

4
2803
by: Jonathan | last post by:
Hi, I've read through quite a number of postings on here so far and have seen what look like very simply, reasonable answers to this question, however I am still completely unable to do what I...
6
3597
by: LRW | last post by:
I have a Javascript that makes a tablerow visible ot invisible, that works fine in InternetExplorer, but in Mozilla it's unresponsive and I get the following Javascript Console error: Error:...
10
13418
by: DettCom | last post by:
Hello, I would like to be able to display or hide fields based on whether a specific Yes/No radio button is selected. This is in conjunction with a posting a just made here in the same group...
7
3337
by: adam | last post by:
i'm working on a portion of a CMS that allows content-admins to browse a product list, and add individual products into the taxonomy by clicking checkboxes next to categories they might belong in....
5
2820
by: Mardy | last post by:
I have an aspx page that contains a drop down and 3 divs and lots of other stuff. I'd like to hide the divs depending on which option from the drop down is selected. It works fine until I do a...
21
2650
by: listaction | last post by:
Folks, I'm trying to implement a tabbed effect with CSS and HTML - no graphics. for some reason, i'm unable to control the width of the tabs. I've pasted the code below. Any help /...
15
12470
by: Markus Ernst | last post by:
Hi When toggling an element on and off by setting its display property via DOM access, display:none is valid for all kinds of elements, but I can't find anything about a generic value for...
6
6137
by: Charlie | last post by:
Hi: I have sections on a page in asp panels. I would like to hide/show using javascript, but don't see a visible property for DIV. How do you do this? Thanks, Charlie
1
6835
by: shalini jain | last post by:
Hi, I want to know how can we do pagination using XSL. There are number of tutorials available on pagination using PHP but nothing with XSL. i am really stuck with my code. Below is the code that...
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
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
7347
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
7416
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...
1
7073
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7506
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...
0
5656
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
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.