Jump to content

Iframe scrolling


tomcat01

Recommended Posts

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 19
Hope it makes sence...

Thanks
Link to comment
https://forums.phpfreaks.com/topic/15890-iframe-scrolling/
Share on other sites

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
<?php
for($i=0; $i<500; $i++) echo $i."<br/>";
echo "<a name='btm'></a>";
?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/15890-iframe-scrolling/#findComment-65194
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.