Click to See Complete Forum and Search --> : moving a text box
pelegk1
07-09-2003, 01:30 AM
i want to make a text box that will "move with me to every where on the screen"!
what i mean is
say i have 1000 line
and i scroll down!
i want when i scroll down that the text box will foloow me!
how do i do that?
thanks in advance
Peleg
Khalid Ali
07-09-2003, 01:42 AM
In NS browsers if you set the elements
css position property to fixed it will do just that(NS browsers )
style="position:fixed;"
for IE however, you will need some calculations...search the forum you should find the solution,I have posted one some time ago..
pelegk1
07-09-2003, 01:51 AM
for beacuse ididnt find :(
Khalid Ali
07-09-2003, 01:52 AM
Let me see if I can find that on my machine,,
Khalid Ali
07-09-2003, 01:58 AM
Ok got it..
try this link
http://68.145.35.86/skills/javascripts/StaticMenu.html
To make it work for you with the text field take a look at this function
function MD(){
if(document.all){
document.getElementById("qlinks").style.top = getPosition() + document.body.scrollTop;
}else{
document.getElementById("qlinks").style.position="fixed";
}
if(!mup){
setTimeout('MD()',1);
}
}
see in this line document.getElementById("qlinks") qlinks is the id of the main container that is made static,you can use this with any other html element(say a text field) e.g
<input id="qlinks">
if you leave the rest of the code intact and just add the above in the page you will see that it will add a static text field in the page,of course you will have to comment out the exisiting "qlinks" element
pelegk1
07-09-2003, 03:24 AM
"ata totach" (u r the man)