PDA

View Full Version : Div display when we unmaximize or resize the browser



pankaj.ghadge
11-06-2008, 12:29 PM
Hello ,

I have a problem.
I want to display div at the corner when we resize or unmaxmize the browser. In the following code i have created a div at right corner. but i am not able to show it when we resize the browser at corner position. please tell me..................

e.g In web-based (Gmail) chatting. when we open the div chat window for chatting and try to ummaximize or resize the browser that window gets move and still we can see that chatting window.

one more problem how create a div over horizontal scroll bar. gmail has created like that. it shows the chat window over horizontal scroll bar. I have given code, in this code how to create a div over horizontal scroll bar please tell me ...................


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style>
.class-div
{
overflow-y: auto;
overflow-x: hidden;
word-wrap: break-word;
//-moz-binding: url('./wordwrap.xml#wordwrap');
}
</style>
<script type="text/javascript">
function openDiv()
{
var newDiv = document.createElement('div'), s = newDiv.style;
var D= document.documentElement;
var Swidth=D.clientWidth;
var Sheight=D.clientHeight;

newDiv.setAttribute('id',"divEntry");
newDiv.className="class-div";
s.border = '1px solid gray';
s.color = '#ccc';
s.width = '200px';
s.height = '200px';
s.backgroundColor = '#488be8';
s.top = Sheight-200-10+'px';
s.left = Swidth-200-10+'px';
s.position = 'fixed';
document.body.appendChild(newDiv);
};
function entervalue(evt)
{

var charCode = (evt.which) ? evt.which : window.event.keyCode;

if(charCode==13)
{
document.getElementById("divEntry").innerHTML+=document.getElementById("txtEnter").value+"<br>";
document.getElementById("txtEnter").value="";
}

}
onload=openDiv;
</script>
</head>
<body>
<input type="text" id="txtEnter" onkeypress="entervalue(event)"> enter a value in this text box and press Enter
</body>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>
test<br>

</html>