/    Sign up×
Community /Pin to ProfileBookmark

moving a text box

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

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliJul 09.2003 — 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..
Copy linkTweet thisAlerts:
@pelegk1authorJul 09.2003 — for beacuse ididnt find ?
Copy linkTweet thisAlerts:
@Khalid_AliJul 09.2003 — Let me see if I can find that on my machine,,
Copy linkTweet thisAlerts:
@Khalid_AliJul 09.2003 — 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
Copy linkTweet thisAlerts:
@pelegk1authorJul 09.2003 — "ata totach" (u r the man)
×

Success!

Help @pelegk1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...