pankaj.ghadge
10-16-2008, 07:39 AM
I have created a div using javascript and applied a css after creating a div but position="fixed" attribute not working for IE.
Following is the code .......
--------------------------------------------------------------------------------------------------------------------------
main.html
<html>
<head>
</head>
<frameset cols="15%, *" id="fs1">
<frame src="left.html" name="left" frameborder="1" id=leftId>
<frame src="right.html" name="right" frameborder="1" id=rightId>
</frameset>
</html>
left.html
<html>
<head>
<link rel="stylesheet" href="test.css" type="text/css" />
<script>
function init()
{
var newDiv=parent.right.document.createElement("div");
newDiv.setAttribute('id',"dhtmlwindowholder");
newDiv.style.width = "30%";
newDiv.style.height = "30%";
newDiv.style.color= "#191970";
newDiv.style.backgroundColor="red";
var Swidth=parent.right.document.body.clientWidth;
var Sheight=parent.right.document.body.clientHeight;
newDiv.style.top=Sheight-300;
newDiv.style.left=Swidth-300;
newDiv.style.position="fixed";
parent.right.document.body.appendChild(newDiv);
}
onload=init
</script>
</head>
<body>
</body>
</html>
right.html
<html>
<head>
<link rel="stylesheet" href="test.css" type="text/css" />
</head>
<body>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
</body>
</html>
-----------------------------------------------------------------------------------------------------------
position="fixed" work well for firefox but not for IE
i have also tried the DOCTYPE like
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
I have used each one of them .............
but still it is not working in IE..................
so please tell me the solution...................
Thanks in advance ......................................
Following is the code .......
--------------------------------------------------------------------------------------------------------------------------
main.html
<html>
<head>
</head>
<frameset cols="15%, *" id="fs1">
<frame src="left.html" name="left" frameborder="1" id=leftId>
<frame src="right.html" name="right" frameborder="1" id=rightId>
</frameset>
</html>
left.html
<html>
<head>
<link rel="stylesheet" href="test.css" type="text/css" />
<script>
function init()
{
var newDiv=parent.right.document.createElement("div");
newDiv.setAttribute('id',"dhtmlwindowholder");
newDiv.style.width = "30%";
newDiv.style.height = "30%";
newDiv.style.color= "#191970";
newDiv.style.backgroundColor="red";
var Swidth=parent.right.document.body.clientWidth;
var Sheight=parent.right.document.body.clientHeight;
newDiv.style.top=Sheight-300;
newDiv.style.left=Swidth-300;
newDiv.style.position="fixed";
parent.right.document.body.appendChild(newDiv);
}
onload=init
</script>
</head>
<body>
</body>
</html>
right.html
<html>
<head>
<link rel="stylesheet" href="test.css" type="text/css" />
</head>
<body>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
something<br>
</body>
</html>
-----------------------------------------------------------------------------------------------------------
position="fixed" work well for firefox but not for IE
i have also tried the DOCTYPE like
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
I have used each one of them .............
but still it is not working in IE..................
so please tell me the solution...................
Thanks in advance ......................................