tomcat01 Posted July 28, 2006 Share Posted July 28, 2006 Hi All, I need help in solving how to automatically scroll content of an iFrame. I want th iframe contant to be shown inside the frame without having to manually scroll down to it.. example code in iframe<?for( $i = 0; $i < 20; $i ++ ){usleep(250000);echo "$i<br>";ob_flush();flush();}?>The iframe needs to auto scroll as the counter goes to 19Hope it makes sence... Thanks Quote Link to comment https://forums.phpfreaks.com/topic/15890-iframe-scrolling/ Share on other sites More sharing options...
wildteen88 Posted July 28, 2006 Share Posted July 28, 2006 In order to make it auto scroll you'll have to use javascript, howver you cannot run PHP and Javascript together. When javascript starts PHP would of finished. If you want to run them together you'll want to use ajax. Quote Link to comment https://forums.phpfreaks.com/topic/15890-iframe-scrolling/#findComment-65185 Share on other sites More sharing options...
tomcat01 Posted July 28, 2006 Author Share Posted July 28, 2006 ThanksDo you know of a working example / code somwhere? Quote Link to comment https://forums.phpfreaks.com/topic/15890-iframe-scrolling/#findComment-65189 Share on other sites More sharing options...
zq29 Posted July 28, 2006 Share Posted July 28, 2006 If you want it to just jump to the bottom of your iframe, you could just use an anchor like the following, but if you want it to scroll as it loads, yes, you need to use the ajax technique.[code]//test.html<iframe src="test2.php#btm" width="400" height="500" scrolling="auto" frameborder="1"> [Your user agent does not support frames or is currently configured not to display frames. So <a href="http://www.getfirefox.com">get firefox</a>.]</iframe>//test2.php<?phpfor($i=0; $i<500; $i++) echo $i."<br/>";echo "<a name='btm'></a>";?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/15890-iframe-scrolling/#findComment-65194 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.