|
-
Oct 25th, 2002, 06:18 AM
#1
Thread Starter
Addicted Member
Netscape 4.7 problem
Hi,
Have a look at the following code
Code:
<html>
<body>
<SCRIPT LANGUAGE="JavaScript"><!--
var hidden = false;
var mytext = "<form name=form1><SELECT Name='Sample'><OPTION Value='This is option 1'>This is option 1</OPTION><OPTION Value='This is option 2'>This is option 2</OPTION><OPTION Value='This is option 3'>This is option 3</OPTION><OPTION Value='This is option 4'>This is option 4</OPTION></SELECT></form>";
function changeit() {
if (hidden) {
if (document.layers) {
document.layers['GenericID'].document.open();
document.layers['GenericID'].document.writeln(mytext);
document.layers['GenericID'].document.close();
}
else if (document.all)
document.all("GenericID").innerHTML= mytext;
}
else {
if (document.layers) {
document.layers['GenericID'].document.open();
document.layers['GenericID'].document.writeln('');
document.layers['GenericID'].document.close();
}
else if (document.all)
document.all("GenericID").innerHTML= '';
}
hidden = !hidden;
}
function getMe()
{
alert(document.form1.Sample.value);
}
//--></SCRIPT>
<table>
<TD>
<Div ID="GenericID" STYLE="position: absolute">
<SCRIPT LANGUAGE="JavaScript"><!--
document.write(mytext);
//--></SCRIPT>
</DIV>
</td>
</table>
<BR><BR><FORM>
<br>
<br>
<INPUT TYPE="BUTTON" VALUE="Click Me" onClick="changeit()">
<Input type="Button" Value="option" OnClick="getMe()">
</FORM>
</body>
</html>
Here I want the DIV tag to be inside a TD. But this works in netscape 4.7,but the contents appear only at the top of the page. But if I remove the position:absolute, it doesn't work. Is there any way that I can position this DIV anywhere I like on the page.
Thanks,
Pres.
-
Oct 28th, 2002, 04:26 AM
#2
Fanatic Member
can't you use a layer instead of a div?
-
Oct 29th, 2002, 04:05 PM
#3
<Div ID="GenericID" STYLE="position: absolute; x: 100; y: 200; width: 300; height: 60">
Something like this, NS 4.7 is outdated...
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 29th, 2002, 11:21 PM
#4
Thread Starter
Addicted Member
I'll try
I'll try this.
Thanks,
Pres
-
Oct 30th, 2002, 06:41 AM
#5
Frenzied Member
Originally posted by CornedBee
<Div ID="GenericID" STYLE="position: absolute; x: 100; y: 200; width: 300; height: 60">
Something like this, NS 4.7 is outdated...
You need a unit (i.e. px) on the co-ordinates otherwise it's invalid and probably won't work in Mozilla or Opera. So it should look more like this:
Code:
<Div ID="GenericID" STYLE="position: absolute; x: 100px; y: 200px; width: 300px; height: 60px">
-
Oct 30th, 2002, 10:45 AM
#6
Yeah, right.
Maybe I should do more HTML to remain trained. Or maybe I should just rely on Dreamweaver and not give any advice anymore
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 30th, 2002, 12:34 PM
#7
Frenzied Member
Hehe, nah it's alright, at least you don't start shouting when someone corrects you, I probably would
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|