Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.