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 6222415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:18:34+00:00 2026-05-24T08:18:34+00:00

I have a button set up that when clicked, expands the page. Here is

  • 0

I have a button set up that when clicked, expands the page. Here is the code:

/*Source:http://rpardz.com/blog/show-hide-content-jquery-tutorial*/

jQuery('.open-content').hide().before('<div class="container_12"><a href="#" id="toggle-content" class="button"><div id="expand-button" ></div></a></div><div id="toggle-top" style="width:100%"></div>');
jQuery('a#toggle-content').click(function() {
    jQuery('.open-content').slideToggle(1000);
    return false;
});

It works nicely as you can see: Hidden: http://cl.ly/101v0N0W1z2D2e0x3a0j Expanded: http://cl.ly/1Z2Q1d3Y2z2X3G1j1v2G

Notice (see the scroll on the side of the images) how the bottom of page expands to show more content; what I can’t figure out is how to make the page auto scroll to the bottom of the now visible content after the page finishes expanding..

I use this standard script to smooth scroll to places on the page..

/*Source: http://goo.gl/DaRfF */
jQuery(document).ready(function($) {

$(".scroll").click(function(event){     
    event.preventDefault();
    $('html,body').animate({scrollTop:$(this.hash).offset().top}, 500);
});

});

but I cannot see how to integrate this so that it automatically scrolls to the bottom of the content after it finishes expanding. All help is greatly appreciated, 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-24T08:18:37+00:00Added an answer on May 24, 2026 at 8:18 am

    what about something like this?

    jQuery('.open-content').slideToggle(1000, function(){
       var offset = jQuery('.open-content').offset();
       var y = offset.top + jQuery('.open-content').height();
       var wheight = $(window).height()
       var scroll = y - wheight;
       $(document).animate({scrollTop:scroll}, 500);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the scenario: I have a set of buttons that I want to bind
I currently have my code set to disable the submit button when the field
I have a button on my page that changes depending on what radio button
I have an options button that, when clicked on, will display a dropdown list
I want to have a Button that when clicked, removes all the checked items
Here's how I set up my app. I have a root view that loads
I have a button that when clicked calls a function - this function does
I have a set of radio buttons that are dynamically generated (via JSON call):
I have a series of buttons that display filenames. If I set the Text
I have an EditText and a Button set next to each other on the

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.