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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:42:08+00:00 2026-06-06T23:42:08+00:00

Basically I have an element which when clicked causes another element to slideToggle. However

  • 0

Basically I have an element which when clicked causes another element to slideToggle. However what I am after is another element, say an image, inside the main parent element that when that is clicked it does not fire off the slideToggle event and can be used to fire another event…

A simplified version of my code is here:

http://jsfiddle.net/s3d5D/6/

..the blue box being a substitute for the image.

Markup:

<div class="holder">
    <div class="section"><div class="image"></div></div>
    <div class="hidden"></div>
</div>

jQuery:

$('.hidden').hide();
$(document).on('click', '.section', function(){
    $(this).nextAll('.hidden:first').slideToggle(500);
});
  • 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-06T23:42:09+00:00Added an answer on June 6, 2026 at 11:42 pm

    The target property of event arguments object contains the element that was really clicked. You can compare it to this (which will contain the related .section element) and find out whether it was the .section that was clicked, or something else:

    $(document).on('click', '.section', function(e){
        if (e.target == this) {
            $(this).nextAll('.hidden:first').slideToggle(500);
        }
    });
    

    I’ve also forked your fiddle to illustrate this approach in action.

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

Sidebar

Related Questions

The title basically says it all. Suppose I have an element which I want
Ok, basically, I have an element that I get which happens to be a
Say I have a div element which is not located at the top of
I have a page where I basically want an element to 'blink' for a
I basically have a program that filters records from one excel file to another
Suppose we have an abstract class Element from which classes Triangle and Quadrilateral are
Which STL container would fit my needs best? I basically have a 10 elements
I have a div element that I'm trying, basically, to move wherever the user
I have two divs, both with position:absolute; , one inside the other. The parent
Basically I have a popup and want to hide it when it is clicked

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.