Click to See Complete Forum and Search --> : layers


okham
11-04-2003, 02:23 PM
...I've been avoiding layers on a page design that I'm up to, but now I think I've got one simple need for using layers, and I should start to learn about it. I asked this question in "javascript," but it may belong in html as well. I read on a website that current browsers ignore the <div> tag, and I was wondering what the alternative was...

okham

pyro
11-04-2003, 04:14 PM
Originally posted by okham
I read on a website that current browsers ignore the <div> tag, and I was wondering what the alternative was...Delete that from your memory, and never visit the site again. <div>'s are the alternative. Other than that, people use <table>s for layout.

okham
11-04-2003, 04:58 PM
...actually that's good news, pyro. <Div> seemed like an orderly way to start layers, to me. Welp, maybe you could walk me through something simple, eh? Essentially, I set up a layer, used an onChange handler in a form option, and then tried to display the layer from the script function. - - Didn't work... can you give me some advice, here it is:

Code
___________________
<div id="polyester" style="LEFT:5px; position:absolute; TOP:5px; visibility:hidden; z-index:1">
<form method="post" action="">
<select name="poly2">
<option name="100" selected>Fabric 100
<option name="200">Fabric 200
</select>
</form>
</div>


<form method="post" action="">
<select name="fabtype" onchange="display();">
<option name="poly1" selected>Polyester
<option name="cott1">Cotton
</select>
</form>



<script language="javascript">
function display() {
document.all[polyester].style.visibility="visible";
}
___________________

pyro
11-04-2003, 06:13 PM
document.all is IE proprietry code. Try the DOM way:

<script language="javascript">
function display() {
document.getElementById("polyester").style.visibility="visible";
}
</script>

okham
11-04-2003, 08:32 PM
...pyro! You're a charm! - - I want you to know I went to the bookstore and just paid 30.00 for a javascript book (well, I need it anyways to learn from), and came home to find your reply that was just what I needed... go figure. Welp, it's all about information exchange. I really wanted to stay uncomplicated about my web project, but I really needed to delve a little bit into the layers thing.

The javascript forum doesn't seem to be as well traveled...I asked the same question there, but haven't got a reply. - -

okham

pyro
11-04-2003, 09:47 PM
Acutally, the JavaScript forums is probably our busiest section. Perhaps your post just got lost in the bunch... Anyway, glad we got it sorted for you. :)