Advertisement

08.23.2006 at 01:15PM PDT, ID: 21965100
[x]
Attachment Details

OnBlur / DIV question

Asked by peh803 in JavaScript

Tags: div, onblur, javascript

Hello Javascript Experts.  

What I want is to be able to have a div show up on a page when a user clicks a button (display=block, this part is no problem), and then when the user clicks anywhere outside the parent div for the div and all child content to go away (onblur).  

So, I have the following code format:
<div onBlur="this.style.display='none';" id="parentDiv" class="parentDiv">
   Stuff in Parent
  <div id="Child1" class="Child1">Stuff in Child 1</div>
  <div id="Child2" class="Child2">Stuff in Child 2</div>
</div>

The problem with this is that when the children get focus, onBlur fires for the parent and the div disappears.  I would like to have the parent div stay visible (display=block) as long as the user is doing anything (clicking) in the parent or any of its children.  Clicking a child should not cause the parent to disappear.  This is my current problem.  

Thank you in advance for your help.

Regards,
Phil / peh803Start Free Trial
[+][-]08.23.2006 at 01:26PM PDT, ID: 17375934

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.23.2006 at 01:28PM PDT, ID: 17375959

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.23.2006 at 02:07PM PDT, ID: 17376265

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.23.2006 at 02:14PM PDT, ID: 17376329

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.23.2006 at 02:59PM PDT, ID: 17376658

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.23.2006 at 03:17PM PDT, ID: 17376849

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: JavaScript
Tags: div, onblur, javascript
Sign Up Now!
Solution Provided By: pravinasar
Participating Experts: 2
Solution Grade: A
 
 
[+][-]08.23.2006 at 06:51PM PDT, ID: 17377839

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.24.2006 at 03:57AM PDT, ID: 17380032

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.24.2006 at 07:57AM PDT, ID: 17382107

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32