Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to stop moving text box at specific point?
    primarykey
    data
    text
    <p>i'm developing a web site i want a div to move when a user click on the text box and i need to stop that div below the clicked text box. i have tried</p> <pre><code>var index = event.target.id </code></pre> <p>but it didn't work i 'm using flowing javascript function</p> <pre><code>&lt;script type="text/javascript"&gt; var cmdStr = window.location.search; cmdStr = (cmdStr.indexOf("menu_id")&gt;-1)?cmdStr.substring(cmdStr.indexOf("=")+1,cmdStr.length):""; var isNS6 = (navigator.userAgent.indexOf("Mozilla")&gt;-1 &amp;&amp; navigator.userAgent.indexOf("Gecko")&gt;-1)?true:false; var isIE = (navigator.userAgent.indexOf("MSIE")&gt;-1 &amp;&amp; navigator.userAgent.indexOf("Opera")==-1)?true:false; var isOp = (navigator.userAgent.indexOf("Opera")&gt;-1)?true:false; function init(){ // if(isIE){ // document.getElementById("msg_scroller").style.position="relative"; // } } var incrementVal = 2; var timer; var flag; function scroll(flag){ var obj = document.getElementById("movingDiv"); var isIE6 = (document.documentElement.clientHeight)? true : false;` var Y = parseInt(obj.style.top); var cY = (isIE6)?document.documentElement.clientHeight-173 :((document.all)? document.body.clientHeight-173:window.innerHeight - 173); if(flag==1 &amp;&amp; Y&lt;cY){ obj.style.top = (Y+incrementVal)+"pt"; timer = setTimeout("scroll(1)",incrementVal*20); }else if(flag==-1 &amp;&amp; Y&gt;0){ obj.style.top = (Y-incrementVal)+"pt"; timer = setTimeout("scroll(-1)",incrementVal*20); }else{ clearTimeout(timer); } } &lt;/script&gt; </code></pre> <p>and my html is </p> <pre><code>&lt;div id="movingDiv" style="position:absolute;left:100pt;top:150pt;border:1px;width:160px;background-color:lightyellow;font-weight:bold;" &gt; &lt;textarea style="font-size: 10pt; font-family: Potha, Malithi Web , Arial Unicode MS; width: 600px;" rows="7"&gt;&lt;/textarea&gt; &lt;text&gt;&lt;/div&gt; </code></pre> <p>i know to stop this i have to get x,y cordinates but how i get this ?? can some one help me?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload