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

  • Home
  • SEARCH
  • 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 6221569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:09:27+00:00 2026-05-24T08:09:27+00:00

<div id=one class=hover>Hover there</div> <div id=one-child class=box><div class=region></div></div> jQuery(function($) { $(.hover).hover(function() { var targetId

  • 0
<div id="one" class="hover">Hover there</div>
<div id="one-child" class="box"><div class="region"></div></div>

jQuery(function($) {
$(".hover").hover(function() {
    var targetId = "#" + this.id + "-child"; //Get the id of the new active box
    $(".box").not(targetId).stop(true, true).hide(); //Stop any previous animations and hide the boxes, if they are not the same as the active box.
    $(targetId).fadeIn(); //Show the current, active box
    $(".active").removeClass("active");
    $(this).addClass("active");
}, $.noop); //Provide jQuery's empty function so nothing gets done on mouseleave.
});


jQuery(document).click(function(event) {
    if (!jQuery(event.target).hasClass("box")) { //If the source of the click is a .box, don't do anything.
        jQuery(".box").fadeOut(); //Otherwise fadeOut() the box
        jQuery(".active").removeClass("active");
    }
});

EDITED 3

http://kazpost.webcoder.kz → all works as intended.
But only one problem left :)) i’ve placed another div inside #one-child. When i press on that div.region inside #one-child → div.box is closes.

  • 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-24T08:09:28+00:00Added an answer on May 24, 2026 at 8:09 am

    EDIT, for latest question:

    jQuery(document).click(function(event) {
        if (jQuery(event.target).closest(".box").length == 0) {
            jQuery(".box").fadeOut();
            jQuery(".act").removeClass("act");
        }
    });
    

    Handling the click can be done using the closest() function to determine whether or not the clicked element is inside a .box.

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

Sidebar

Related Questions

I'm using hover() as suggested in the documentation: $(#div).hover( function(){$(this).addClass('cie_hover');}, function(){$(this).removeClass('cie_hover') ;} ); Is
I have a function in Javascript that moves one div depending on the mouse
<div id='one'>one</div> <div id='two'>two</div> function Red(e) { $(e.target).css('color','red'); } // if i bind an
I have one javascript function. Which i want to call on hover of li
I am using Jquery to do a disjointed hover effect. I have a div
I am inserting content to a div using jquery like: $('#divItem').append(<a href='abcd.aspx' class=toolTip target='_blank'>Go
There are 3 div s and 3 links. Only one div should be displayed
Given the following HTML example... <div id='div1'>div one</div> <div id='div2'>div two</div> ...I found that
I have one large div with one smaller div inside it. The smaller div
The scenario is I have two div s: one is where I select items

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.