ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Scroll DIV position to focussed TextBox using jQuery<p>Hi <a class="username" rel="nauna"> nauna</a>,</p> <blockquote><cite>nauna says:</cite> <pre>6 vice versa if user again click on textbox 5 so it should downside textbox 6 and textbox 7 and user can textbo 3 4 and 5</pre> </blockquote> <p>For the above condition its not possible.</p> <p>But you can do in this way.</p> <p>Check this example. Now please take its reference and correct your code.</p> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <div class="demo_block"> <pre class="brush: html">&lt;div id=&#34;div1&#34; style=&#34;max-height: 170px; overflow: hidden;&#34;&gt; &nbsp;&nbsp;&nbsp; TextBox 1 &nbsp;&nbsp;&nbsp; &lt;input name=&#34;TextBox1&#34; type=&#34;text&#34; id=&#34;TextBox1&#34; class=&#34;test&#34; /&gt;&lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; TextBox 2 &nbsp;&nbsp;&nbsp; &lt;input name=&#34;TextBox2&#34; type=&#34;text&#34; id=&#34;TextBox2&#34; class=&#34;test&#34; /&gt;&lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; TextBox 3 &nbsp;&nbsp;&nbsp; &lt;input name=&#34;TextBox3&#34; type=&#34;text&#34; id=&#34;TextBox3&#34; class=&#34;test&#34; /&gt;&lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; TextBox 4 &nbsp;&nbsp;&nbsp; &lt;input name=&#34;TextBox4&#34; type=&#34;text&#34; id=&#34;TextBox4&#34; class=&#34;test&#34; /&gt;&lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; TextBox 5 &nbsp;&nbsp;&nbsp; &lt;input name=&#34;TextBox5&#34; type=&#34;text&#34; id=&#34;TextBox5&#34; class=&#34;test&#34; /&gt;&lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; TextBox 6 &nbsp;&nbsp;&nbsp; &lt;input name=&#34;TextBox6&#34; type=&#34;text&#34; id=&#34;TextBox6&#34; class=&#34;test&#34; /&gt;&lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; TextBox 7 &nbsp;&nbsp;&nbsp; &lt;input name=&#34;TextBox7&#34; type=&#34;text&#34; id=&#34;TextBox7&#34; class=&#34;test&#34; /&gt;&lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &lt;/div&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; &nbsp;&nbsp;&nbsp; $(function () { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(&#39;.test&#39;).on(&#39;focus&#39;, function () { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var elem = $(this); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var parent = $(&#39;#div1&#39;); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var scrollOffset = parent.scrollTop() + elem.offset().top; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; parent.animate({ scrollTop: scrollOffset - 10 }, 1500); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }); &nbsp;&nbsp;&nbsp; }); &lt;/script&gt;</pre> </div> <p><a class="demo button orange btn btn-red">Demo</a></p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/367449/Scroll-DIV-position-to-focussed-TextBox-using-jQuery/https://www.aspforums.net:443/Threads/367449/Scroll-DIV-position-to-focussed-TextBox-using-jQuery/Tue, 11 Sep 2018 01:22:33 GMT