soma56 Posted June 13, 2010 Share Posted June 13, 2010 Let's say I had an array of results coming in line-by-line and a placed it around a nice CSS box: <html> <head> <title>My Super List</title> <style> div.customScroll {position:absolute; top:30px; overflow:scroll; margin-left:0px; left:20%; width:350px; height:420px; border:2px lightblue solid!important; } </style> </head> <body> <div class="customScroll"> <?PHP # Importing My Clean Data $data = explode("$cleaned_data"); echo $value . "<br />" . PHP_EOL; flush(); ob_flush(); usleep(50000); } } ?> </div> </body></html> So everything transfers nicely to a box. However if the information is long wouldn't it be nice if the box automatically scrolled with the data so users could read it as it came in rather then being "stag-net" at the top as the array fills in. Link to comment https://forums.phpfreaks.com/topic/204669-is-there-a-way-to-autoscroll-with-php/ Share on other sites More sharing options...
soma56 Posted June 13, 2010 Author Share Posted June 13, 2010 Let's say I had an array of results coming in line-by-line and a placed it around a nice CSS box: <html> <head> <title>My Super List</title> <style> div.customScroll {position:absolute; top:30px; overflow:scroll; margin-left:0px; left:20%; width:350px; height:420px; border:2px lightblue solid!important; } </style> </head> <body> <div class="customScroll"> <?PHP # Importing My Clean Data $data = explode("$cleaned_data"); echo $value . "<br />" . PHP_EOL; flush(); ob_flush(); usleep(50000); } } ?> </div> </body></html> So everything transfers nicely to a box. However if the information is long wouldn't it be nice if the box automatically scrolled with the data so users could read it as it came in rather then being "stag-net" at the top as the array fills in. I've tried the CSS overflow:auto; and it doesn't work. Does anyone have any suggestions for PHP? Link to comment https://forums.phpfreaks.com/topic/204669-is-there-a-way-to-autoscroll-with-php/#findComment-1071553 Share on other sites More sharing options...
JasonLewis Posted June 14, 2010 Share Posted June 14, 2010 Fairly sure you can't do it in PHP. You'd need to write a piece of JavaScript, to keep the scrollbar at the bottom. Link to comment https://forums.phpfreaks.com/topic/204669-is-there-a-way-to-autoscroll-with-php/#findComment-1071684 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.