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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:58:20+00:00 2026-06-01T02:58:20+00:00

I am trying to pop up a box when a div or any of

  • 0

I am trying to pop up a box when a div or any of its first level children are clicked, excluding one A tag that is in a child div.

I am simply switching classes to show/hide the div which works great. However, when the link is clicked the box still pops up which I dont want. I have looked at using target and stoppropagation but I cannot get it to work with my code.

jQuery:

jQuery(document).ready(function() {
    jQuery(".video_odd").toggle(function()
    {
    jQuery(this).children(".video_desc_box").attr('class', 'video_desc_box_open');
    },
    function(){
    jQuery(this).children(".video_desc_box_open").attr('class', 'video_desc_box');
    });
});

Quick HTML overview: video_odd is the class that when it is clicked it will cause its child div video_desc_box to switch its class to video_desc_box_open which changes display to inline instead of none.

I just don’t understand how to use toggle to get this script to not run when a link is clicked which is a div inside video_odd.

I want it to change classes when any other childen is clicked, just not the 2nd level child link.

Thanks for the help!

EDIT: I think I am getting closer:

jQuery(".video_odd").toggle(function(e)
{
if (e.target == jQuery(this).children(".video_list_title")) { return; }
jQuery(this).children(".video_desc_box").attr('class', 'video_desc_box_open');
},
function(){
jQuery(this).children(".video_desc_box_open").attr('class', 'video_desc_box');
});  

However

(e.target == jQuery(this).children(".video_list_title"))

Is not registering. How can I have it exclude the div video_list_title all together (not just the link?)

  • 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-01T02:58:23+00:00Added an answer on June 1, 2026 at 2:58 am

    e.target is not a jQuery.

    $(e.target).hasClass(“video_list_title”)

    Is a lot closer!

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

Sidebar

Related Questions

I'm trying to create one of those pop-up boxes you'll get the first time
I'm trying to create a pop up box (with jQuery) that can handle forms,
I am trying to create a button that can pop up the speech input
I am trying to get a message box to pop up in front of
ive been trying to pop up a custom dialog box when tapping on a
I am trying to create a hint dialog box that informs the user about
I am trying to use Simplemodal as a pop up box on an index
I'm trying to get a pop up text box, with some disclaimer and app
I'm trying to use an auto-complete widget that gets its data from a remote
I'm trying to use the GetOpenFileName() common dialog box call to pop open a

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.