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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:09:22+00:00 2026-05-17T18:09:22+00:00

I have an FAQ and would like to attach an image to the right

  • 0

I have an FAQ and would like to attach an image to the right of the question that tells the person to close if open and open if closed.

This is what I have:

$('.header-person').click(function() {
    $(this).next('.entry').slideToggle("fast")
    return false;
});

I currently have the two images next to the question like so:

question 1  

<span class="icon"><img src="open.png" width="16" height="16" border="0" /></span>


<span style="display:none;" id="icon-delete"><img src="close-32.png" width="16" height="16" border="0" /></span>

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-17T18:09:23+00:00Added an answer on May 17, 2026 at 6:09 pm

    No need to wrap your images in spans. You can just put the class for each image directly on it, and toggle it that way. Additionally, you might want to watch out for the functionality of .next(), as it might not work how you are expecting it to. It only grabs the immediate next sibling. This means that if there are any siblings between the element you call it on and the one you are looking for, you won’t find it.

    Check out the documentation for .next(): http://api.jquery.com/next/

    Instead try using .nextAll() with a filter selector to find the element you want.

    Documentation for .nextAll(): http://api.jquery.com/nextAll/

    That being said, here’s a demo that does what you want (I think): http://jsfiddle.net/Ender/9eXnW/1/

    Basically what you want to do is just make sure that you have the visibility of each of the images set properly to start with, then just select them both and call .toggle() on them in your click event.

    Check out the code:

    $(function() {
        $('.entry').hide();
        $('.header-person').click(function(e) {
            e.preventDefault();
            $(this).nextAll('.entry:first').slideToggle("fast");
            $(this).children('.close-icon, .open-icon').toggle();
        });
    });
    

    Additionally, I’ve changed your return false; to e.preventDefault()

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

Sidebar

Related Questions

Maybe a FAQ at this website. I have a TableViewController that holds a form.
I would like to create links that have icons included in the link. For
I have a question based on this question In the section http://www.parashift.com/c%2B%2B-faq-lite/private-inheritance.html#faq-24.3 the following
I have a code setup for a FAQ page like this: <p><strong>This Is A
I have this code i would like to know if there is a shorter
I'm a PHP newb. Sorry if this is an FAQ... Let's say I have
I'm working with MVC3 and EF4. I would like to create a multilingual FAQ
Here's a quick one. In my navigation.xml I have this type of structure. <faq>
I would like to make a FAQ page similar to here: Forum FAQ using
We are using Plone 4.1, and would like to have a custom view of

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.