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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:30:58+00:00 2026-05-28T08:30:58+00:00

I have a html webpage where I have a list that when an item

  • 0

I have a html webpage where I have a list that when an item is clicked it will expand some text and make the container increase in height. What is the best way to detect the contracting of a list item.

For example when I click an item it expands and everthing increases in size correctly. However when I click the same item again, it increases the container again, because I am not sure how to distinguish the expand and contract, using one function for all the items on the list.

function slidedown(id){
  $('#'+id.id+'text').slideToggle(250);   
  var height = document.getElementById("aboutmiddle").style.height
  value = parseInt(height);
  value +=100;
  document.getElementById("aboutmiddle").style.height = value+"px";
}

as you can see on click I want it to increase the height of aboutmiddle but I would like to decrease aboutmiddle height on the second click.

  • 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-28T08:30:59+00:00Added an answer on May 28, 2026 at 8:30 am

    Jquery has a toggle function that’ll do this for you

    <div id="clickme">
      Click here
    </div>
    <img id="book" src="book.png" alt="" width="100" height="123" />
    <script>
      $('#clickme').click(function() {
        $('#book').toggle('slow', function() {
          // Animation complete.
        });
      });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a txt file which actually is a html source of some webpage.
On extracting some html from a web page, I have some elements containing text
I have a web page with a read-only text box which shows some HTML
I have html code that looks roughly like this: <div id=id1> <div id=id2> <p>some
I have a webpage that accepts HTML-input from users. The input is converted into
Have a webpage that will be viewed by mainly IE users, so CSS3 is
I am dealing with a webpage that has multiple forms..some basic HTML forms and
I have a webpage that redirects to another webpage like this: http://www.myOtherServer.com/Sponsor.php?RedirectPage=http://mylink.com/whereIwasgoingtogo.html Then the
according to the HTML Standards ID-Attributes of any HTML Tag in a webpage have
I have HTML that includes symbols such as the Trademark TM as superscript (™).

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.