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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:17:04+00:00 2026-06-15T12:17:04+00:00

I have a problem with a simple jQuery accordion script. I’m using it on

  • 0

I have a problem with a simple jQuery accordion script. I’m using it on this page to list a few events: http://www.melisayavas.com/kush-project/

The problem I’m having is that the script collapses when the user clicks anywhere inside the wrapper. I need the script to collapse only when the user clicks on the title of the event.

You can see this jsfiddle that has the same problem: http://jsfiddle.net/mcDeE/

The full code of the script I’m using can be found here: http://pastebin.com/hJEufLQU

This is the HTML:

<div id="va-accordion" class="va-container" style="">
    <div class="va-wrapper">
        <div class="va-slice" style="opacity: 1;">
            <div class="va-title" style="">
                <h2>Relationship, 26 February 2013</h2>
            </div>
            <div class="va-content" style="display: block;">
                <div class="event-left"></div>
                <div class="event-right"></div>
            </div>
        </div>
        <div class="va-slice" style="opacity: 0.2;">
        <div class="va-slice" style="opacity: 0.2;">
    </div>
</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-15T12:17:05+00:00Added an answer on June 15, 2026 at 12:17 pm

    The problem I’m having is that the script collapses when the user clicks anywhere inside the wrapper.
    I need the script to collapse only when the user clicks on the title of the event.

    In order to get your desired result you have to block the event propagation before it reaches the accordion root element.
    You only need to do this when the click occurs on the .va-content element.

    $(function() {
        $('#va-accordion').vaccordion();
        $(".va-content").click(function(e) {
            e.stopPropagation();                    
        });
    });
    

    Why this work?

    Events propogate starting from the root element till the target element (capture phase) and after reaching the target,
    they climb up back to the root element (bubbling phase).
    The target element is the element that received the event.

    It’s possible to register event listeners both on the capture phase, both on the bubbling phase.
    Here, we’re using jQuery that registers the event on the bubbling phase.

    stopPropagation permits to block the event propagation through the DOM.

    That’s an article I wrote, in case you need more info about W3C event model.

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

Sidebar

Related Questions

I have problem with simple jquery sliding menu, here is my code: http://jsfiddle.net/kCK44/1/ what
I have a simple problem using Jquery. I want to display detailed information under
I have a simple accordion menu I've put together today using the jQuery slideDown()
I have a simple jQuery script. This is the script: var menu = $('#nav
I have problem with passing an argument to my simple function in jQuery: When
I have the following problem: I am creating a simple plugin jquery carousel, to
I have a very simple JavaScript/jquery code which won't just work correctly. The problem
I have problem with creating a simple MySQL trigger in C#. I'm using StringBuilder
I have a jQuery accordion from this site and edited for my purposes, but
i am begginer to jquery and have a simple problem.. I want to make

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.