B. Chernick wrote:
Thanks. I'm going to have to try this but frankly, the syntax looks a little
strange to me. I'm not sure I understand what I'm seeing.
Yes, the syntax might look a bit strange if you are not used to it.
Another way of writing the show function, that you may be more familiar
with, could be:
function show(index) {
var items = new Arra();
items[0] = document.getElementById('item1');
items[1] = document.getElementById('item2');
items[2] = document.getElementById('item3');
for (var i=0; i<items.length; i++) {
if (i==index) {
items[i].style.display = 'block';
} else {
items[i].style.display = 'none';
}
}
return false;
}
What I've been
doing is more like this:
var t = document.getElementById("F0006");
t.style.visibility='hidden';
The problem is that even though the table is hidden, it's still taking up
space.
Yes, that's how the visibility attribute works. It shows or hides an
element, but it still takes up space in the document flow all the time.
The display attribute controls how the element behaves in the document
flow. The value 'block' makes it behave like a div element, the value
'inline' makes it behave like a span element, and the value 'none'
removes it from the document flow entirely.
As you probably want one page at the time to be visible, and the other
pages totally out of the way, the display attribute is a better option
than the visibiliy attribute.
--
Göran Andersson
_____
http://www.guffa.com