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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:57:11+00:00 2026-05-27T22:57:11+00:00

I’m new to jQuery. I’m using .slideToggle to make a DIV appear at the

  • 0

I’m new to jQuery. I’m using .slideToggle to make a DIV appear at the bottom of all my content. I have got the code to make the DIV appear, and the page to scroll down to that DIV.

However, I want to make an additional button/link that would then hide the content and scroll back up.

The code I have got allows me to do all this but with only one link that toggles the show and hide, which isn’t very useful as I need the hide link to be at the bottom of all my content now.

Please let me know if you have any ideas of how to do this.

jQuery Code

var height = $('#slickbox').hide().height();
$('.more a').toggle(function() {
    $('#slickbox').slideDown(3200);
    $('html, body').animate({ scrollTop: '+=' + height }, 3200);
    return false;
}, function() {
    $('#slickbox').slideUp(3200);
    $('html, body').animate({ scrollTop: '-=' + height }, 3200);
    return false;
});

HTML

<div style="height: 300px; border: solid 1px #ddd;">I'm using space!</div>
<div class="donate done">
    <h3 class="more"><a href="#" title="More"> More </a></h3>
</div>
<div id="slickbox">
    <div id="slide_show">
        <div id="slider">
            <ul>
                <li>
                    <img alt="figure 1" src="http://dummyimage.com/700x1300/000/fff&text=I'm+a+picture!,+woohoo!" width="700" height="1300" />
                </li>
                <li>
                    <img alt="figure 1" src="http://dummyimage.com/700x1300/000/fff&text=I'm+a+picture!,+woohoo!" width="700" height="1300" />
                </li>
            </ul>
        </div>
    </div>
</div>
<div class="close">
    <h3 class="more"><a href="#" title="More">Close</a></h3>
</div>

Here is an example of what I’ve got so far: http://jsfiddle.net/eMYJx/47/

When you click the more button, everything drops and scrolls the way I want. But when you press the close button, you have to press it twice. Any ideas on a way around this?

  • 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-27T22:57:11+00:00Added an answer on May 27, 2026 at 10:57 pm

    I would do it like this. Use one link that you toggle between More/Close. I use the animation callback to make the switch.

    http://jsfiddle.net/eMYJx/49/

    var height = $('#slickbox').hide().height();
    $('.more a').toggle(function() {
        var $this = $(this);
        $('#slickbox').slideDown(3200);
        $('html, body').animate({ scrollTop: '+=' + height }, 3200, function() {
             $this.html('Close');
        });     
        return false;
    }, function() {
        var $this = $(this);
        $('#slickbox').slideUp(3200);
        $('html, body').animate({ scrollTop: '-=' + height }, 3200, function(){
            $this.html('More');
        });
        $(this).html('More');
        return false;
    });
    

    Alternatively if you want to keep both buttons you would bind separate handlers to each. Both for click, but one ‘more’ would execute the first part of your toggle code and ‘close’ would execute the second half.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker

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.