Pawan_Agarwal Posted July 18, 2013 Share Posted July 18, 2013 </html> <script type="text/javascript"> var inc = 10; function move_down() { bar = document.getElementById('tarea'); inc += 10; bar.scrollTop = inc; document.getElementById("write").innerHTML = inc; } function move_up() { bar = document.getElementById('tarea'); inc -= 10; bar.scrollTop = inc; document.getElementById("write").innerHTML = inc; } setInterval( function() { if(inc>=450) {move_up();} if(inc<450) {move_down();} } ,100); </script> <body> This is a code that will help in running data in the same loation, vertically <br> <br> <textarea rows="10" cols="20" id="tarea"> this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text </textarea> <br><br> <button onclick="movedown()" id="tarea">Click here</button><br> <div id="write"></div> </body> </html> I am trying to make a auto scroll function in java script, however, I am unable to do it, can you help with the code and tell what is wrong with the code .................... Quote Link to comment https://forums.phpfreaks.com/topic/280287-auto-scroll-bar-of-text-area/ Share on other sites More sharing options...
Pawan_Agarwal Posted July 29, 2013 Author Share Posted July 29, 2013 is there anyone to answer this question ??????? Quote Link to comment https://forums.phpfreaks.com/topic/280287-auto-scroll-bar-of-text-area/#findComment-1442547 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.