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

  • Home
  • SEARCH
  • 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 9320555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:39:51+00:00 2026-06-19T03:39:51+00:00

This is my jQuery: $(‘#help’).toggle(function () { $(‘#center’).animate({ paddingTop: ’70px’ }, 200); $(‘.child_help’).slideDown(300); },

  • 0

This is my jQuery:

$('#help').toggle(function () {
  $('#center').animate({
    paddingTop: '70px'
  }, 200);
  $('.child_help').slideDown(300);
}, function () {
  $('#center').animate({
    paddingTop: '50px'
  }, 200);
  $('.child_help').slideUp(300);
});

When I load the page, it instead toggles the visibility of #help. What I want to do is when you click it, it should slide .child_help either up or down, and do some padding animations.
On the jQuery API, it only says this:
Note: jQuery also provides an animation method named .toggle() that toggles the visibility of elements. Whether the animation or the event method is fired depends on the set of arguments passed.

The only difference that I can see between what would fire the event, or toggle the visibility, is if it’s $('#help').toggle(function () { do something here }), instead of $('#help').toggle('slow');

Is there something I’m missing here?

Edit: The following is my HTML

<div id="center">
  <div class="child_help">
    some help text here
  </div>
  <div class="child">
    <b>Account Activation</b>
    <img src="/css/images/help.png" alt="" id="help" />
  </div>
  <form method='post'>
    <input type="text" name="code" value="Code" class="code" />
    <span class="case">Case-sensitive</span>
    <input type="submit" name="submit" value="Activate" class="submit" />
  </form>
</div>
  • 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-06-19T03:39:52+00:00Added an answer on June 19, 2026 at 3:39 am

    Demo

    $(function(){
      $("#help").click(function(){
         var padding="70px";
         if($(".child_help").css("display")=="none") padding="50px";
    
         $('#center').animate({
             paddingTop: padding
         }, 200);
    
         $(".child_help").slideToggle();
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this jQuery snippet: $(function() { $(ul > li).hover(function() { $(this).find(ul).stop(true, true).animate({opacity: 'toggle'},
I used this jquery to move a div by every click. $(document).ready(function(){ $('#hero').click(function(){ $(this).animate({
I have this jQuery function: $('.scrollToLoginBox').click(function(){ $('html, body').animate({scrollTop: $("#LoginBox").offset().top-5}, 'slow'); }); I don't want
I've this jquery: <div class=slider-frame> <span class=slider-button>Change</span> </div> $('.slider-button').toggle(function() { $(this).addClass('on').html('Home'); },function(){ $(this).removeClass('on').html('Away'); });​
I have this jquery code which works great: $(document).scroll(function(){ if ($(this).scrollTop()>175){ // animate fixed
I have this jQuery function : $('a[name=pmRead]').click(function(e) { e.preventDefault(); $(this).parents(.pmMain).find(.pmMain5).toggle(); $.ajax({ type: 'POST', cache:
Why doesn't this jQuery code work? $(document).ready(function () { $('currentPage').click(function() { $('myaccount').slideDown('slow', function() {
I have this JQuery toggle/collapse function but some reason timelineEventWide which I added myself
Using this jquery code: <a href=javascript:void(0) id=m1>Get Selected id's</a> jQuery(#m1).click( function() { var s;
I have this jquery function that works, except I need to add something. I

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.