Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6018323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:15:31+00:00 2026-05-23T03:15:31+00:00

I was like on every question about this on the net, tried like 50

  • 0

I was like on every question about this on the net, tried like 50 diff methods, first i tried to scroll the div – then when its not worked i’ve tried to iframe the file with the div and scroll the iframe.. nothing just works!

Look on the last script i have set up:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var t = 100; //arbitrary time in ms
$("#frame").animate({ scrollTop: $("#frame").height()}, t);
});
</script>

<center><iframe id="frame" src="xxx.php" frameborder="0" width="630px" height="500px"></iframe></center>

I tried both #frame and frame without the (#), both with (document).ready and without it.
Nothing seems to work on the page and its driving me nutz.

Thanks. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:15:32+00:00Added an answer on May 23, 2026 at 3:15 am

    With jQuery you need to use .contents() to access whatever’s inside the iframe. You also need to use either the window load event, or the iframe’s document ready event.

    $(window).load(function ()
    {
        var $contents = $('#frame').contents();
        $contents.scrollTop($contents.height());
    });
    

    Demo: http://jsbin.com/ujuci5/2


    I would recommend going back to the div structure you mentioned, since it sounds like what you’re trying to do doesn’t require an iframe. You’ll find that it’s a lot less headache to work with a div than an iframe.

    $(function ()
    {
      var $mydiv = $('#mydiv');
      $mydiv.scrollTop($mydiv.height());
    });
    

    Demo: http://jsbin.com/ujusa4/2


    how can i launch the scroll function like 3 seconds after the page loads?

    Use setTimeout.

    $(window).load(function ()
    {
        setTimeout(function ()
        {
            var $contents = $('#frame').contents();
            $contents.scrollTop($contents.height());
        }, 3000); // ms = 3 sec
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there are two posts about this error on SO. Like every google
First, I apologize if this is not an appropriate venue to ask this question,
My question is about handling temporary files in a small .NET program. This program/utility
So I want to design a team/player relationship like this: every player belongs to
(Unfortunately, this question is about a non-recommended practice. While I appreciate advise against doing
Here's the question first: Is this possible? I'm taking my inspiration from Joe Wrobel's
This question is more about organizing the directories/files on my computer. However, this IS
My question is about order of execution guarantees in C# (and presumably .Net in
Consider this document fragment: <div id=test> <h1>An article about John</h1> <p>The frist paragraph is
First let me say that I really feel directionless on this question. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.