[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How do you hold a textbox still while the webpage is scrolled?

Posted on 2004-10-11
4
Medium Priority
?
220 Views
Last Modified: 2010-04-07
say I have a textbox...

id=txtTest

How can I get this to remain visible at all times when the page is being scrolled. I have posted this question several times and no one seems to provide any answer. Thus your help will be greatly appreciated.

Kind Regards

Paul G
0
Comment
Question by:pgilfeather
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Author Comment

by:pgilfeather
ID: 12276555
Sorry, I forgot to say

Im using VB.NET
0
 
LVL 5

Expert Comment

by:stumpy1
ID: 12277009
If i am understanding your question correctly you want the textbox to float on the screen while you scrool the page.

The only way I can imagine doing it is using Clientside Javascript to dynamically change its position in the browser.
0
 
LVL 28

Expert Comment

by:mmarinov
ID: 12277055
Hi pgilfeather,

look at this article : http://www.mompswebdesign.com/dhtml/always_on_top_menu.html
it is about menu, but you can easy translate it for textbox

Regards!
B..M
0
 
LVL 18

Accepted Solution

by:
tusharashah earned 2000 total points
ID: 12277057
Check out this code:

<html>

<script type="text/javascript">
var gTimer2 = null;
var gTimer2Count = 0;

function Timer2()
{
  gTimer2Count++;
  document.getElementById('txtBox').value = "Timer2 Running - " + gTimer2Count;
}
gTimer2 = window.setInterval("Timer2()",1000);

</script>

<body >



<div id="divTopRight"    style="position:absolute">
<input id='txtBox' type='TextBox' size="20" OnLoad = 'JSTimer();'/>

</div>
<script type="text/javascript">
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
var px = document.layers ? "" : "px";
function JSFX_FloatDiv(id, sx, sy)
{
      var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
      window[id + "_obj"] = el;
      if(d.layers)el.style=el;
      el.cx = el.sx = sx;el.cy = el.sy = sy;
      el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};
      el.flt=function()
      {
            var pX, pY;
            pX = (this.sx >= 0) ? 0 : ns ? innerWidth :
            document.documentElement && document.documentElement.clientWidth ?
            document.documentElement.clientWidth : document.body.clientWidth;
            pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ?
            document.documentElement.scrollTop : document.body.scrollTop;
            if(this.sy<0)
            pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ?
            document.documentElement.clientHeight : document.body.clientHeight;
            this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
            this.sP(this.cx, this.cy);
            setTimeout(this.id + "_obj.flt()", 40);
      }
      return el;
}
JSFX_FloatDiv("divTopRight",         -100,   10).flt();

</script>
</body>

</html>
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question