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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:02:57+00:00 2026-06-18T17:02:57+00:00

I need some help with hiding a div when a user clicks on it

  • 0

I need some help with hiding a div when a user clicks on it and also sliding down the content of the div that is hidden.The following code is for sliding down the hidden div.

    $(document).ready(function (){ $('.hide').hide();
    $('.main:has(".hide")').find('div.toggle').click(function() {
       var el = $(this).next('.hide'),
       check = (el.is(':visible')) ? el.slideUp() : ($('.hide').slideUp()) (el.slideDown());
    });

    });

The above example is here and this link has the full markup and some experiment that I tried to hide the read more div but it hides every div.Also if someone would help me explain the above if else shorthand statement.

Thanks everyone my query is solved 🙂

  • 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-18T17:02:59+00:00Added an answer on June 18, 2026 at 5:02 pm

    I think what you need to learn is how to use this.
    this is a keyword that refers to the element you click on.
    So, you can do something like $(this).hide() or remove(), or toggle(), or what ever you want.

    http://jsbin.com/awirap/5/edit

    JQuery this

    Edit: To show the read more when you click on another you will do this:

    $('.toggle').show();

    You show all of them, and then after this bit of code you do $(this).hide(); to hide only the one you’ve clicked on.

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

Sidebar

Related Questions

need some help! I'm trying to write some code in objective-c that requires part-of-speech
I need some help about PHP GD. Here is my piece of code. header(Content-type:
I need some help removing spaces after hiding certain HTML elements. In context, I
Need some help assigning a mouseover event to display some icons that start out
Need some help with Python syntax Pesudo code if param is not None in
Need some help, I have a regular expression that appears to work just fine
Need some help to write a C# code to send mail to multiple users
Need some help refactoring this if/else block that builds the conditions for a find
Need some help refactoring this code: $(span[rel=color_content]).ColorPicker({ onChange: function (hsb, hex, rg) { $(span[rel=color_content]).css('background-color',
Need some help guys. For now, I can successfully get a single user timeline

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.