469,625 Members | 1,097 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,625 developers. It's quick & easy.

extend behavior to congruent div

Ok, I've got a div, and it has an onMouseOver handler attached to it
which makes a second div visible. The second div shares part of one side
with the first, but not all.

The first div also has an onMouseOut handler which, you guessed it,
makes the second div invisible.

However, if the user rolls out of the first div and into the second, I'd
like to keep the second div visible.

Any ideas how to accomplish this?

stedae
Jul 23 '05 #1
5 1169
In article <sd*****************************@netnews.comcast.n et>,
Steven Daedelus <sd*******@ira.gov> wrote:
Ok, I've got a div, and it has an onMouseOver handler attached to it
which makes a second div visible. The second div shares part of one side
with the first, but not all.

The first div also has an onMouseOut handler which, you guessed it,
makes the second div invisible.

However, if the user rolls out of the first div and into the second, I'd
like to keep the second div visible.

Any ideas how to accomplish this?

stedae


As so often happens, I answered my own question moments after posting
this.

To any who are interested, the solution is very simple: put the same
handlers and second div.

stedae
Jul 23 '05 #2
Lee
Steven Daedelus said:

Ok, I've got a div, and it has an onMouseOver handler attached to it
which makes a second div visible. The second div shares part of one side
with the first, but not all.

The first div also has an onMouseOut handler which, you guessed it,
makes the second div invisible.

However, if the user rolls out of the first div and into the second, I'd
like to keep the second div visible.

Any ideas how to accomplish this?


Rather than making the second div invisible immediately,
the onmouseout handler of the first div schedules it to
happen after a very short delay (50ms?) using setTimeout().
The onmousover handler of the second div cancels that
scheduled event, using clearTimeout().

Jul 23 '05 #3
In article <c9*********@drn.newsguy.com>,
Lee <RE**************@cox.net> wrote:
Steven Daedelus said:

Ok, I've got a div, and it has an onMouseOver handler attached to it
which makes a second div visible. The second div shares part of one side
with the first, but not all.

The first div also has an onMouseOut handler which, you guessed it,
makes the second div invisible.

However, if the user rolls out of the first div and into the second, I'd
like to keep the second div visible.

Any ideas how to accomplish this?


Rather than making the second div invisible immediately,
the onmouseout handler of the first div schedules it to
happen after a very short delay (50ms?) using setTimeout().
The onmousover handler of the second div cancels that
scheduled event, using clearTimeout().


I tried that. For some reason the timeout was creating all sorts of
weird behaviors besides the one I wanted. But in any case, as my
subsequent post points out, it's not necessary. I discovered that
putting the same handlers on the second div works just fine.
Jul 23 '05 #4
Lee
Steven Daedelus said:

In article <c9*********@drn.newsguy.com>,
Lee <RE**************@cox.net> wrote:
Steven Daedelus said:
>
>Ok, I've got a div, and it has an onMouseOver handler attached to it
>which makes a second div visible. The second div shares part of one side
>with the first, but not all.
>
>The first div also has an onMouseOut handler which, you guessed it,
>makes the second div invisible.
>
>However, if the user rolls out of the first div and into the second, I'd
>like to keep the second div visible.
>
>Any ideas how to accomplish this?


Rather than making the second div invisible immediately,
the onmouseout handler of the first div schedules it to
happen after a very short delay (50ms?) using setTimeout().
The onmousover handler of the second div cancels that
scheduled event, using clearTimeout().


I tried that. For some reason the timeout was creating all sorts of
weird behaviors besides the one I wanted. But in any case, as my
subsequent post points out, it's not necessary. I discovered that
putting the same handlers on the second div works just fine.


That may not be true in all browsers. In some, the second
div may pop down before it can take focus.

Jul 23 '05 #5
In article <c9*********@drn.newsguy.com>,
Lee <RE**************@cox.net> wrote:
Steven Daedelus said:

In article <c9*********@drn.newsguy.com>,
Lee <RE**************@cox.net> wrote:
Steven Daedelus said:
>
>Ok, I've got a div, and it has an onMouseOver handler attached to it
>which makes a second div visible. The second div shares part of one side
>with the first, but not all.
>
>The first div also has an onMouseOut handler which, you guessed it,
>makes the second div invisible.
>
>However, if the user rolls out of the first div and into the second, I'd
>like to keep the second div visible.
>
>Any ideas how to accomplish this?

Rather than making the second div invisible immediately,
the onmouseout handler of the first div schedules it to
happen after a very short delay (50ms?) using setTimeout().
The onmousover handler of the second div cancels that
scheduled event, using clearTimeout().


I tried that. For some reason the timeout was creating all sorts of
weird behaviors besides the one I wanted. But in any case, as my
subsequent post points out, it's not necessary. I discovered that
putting the same handlers on the second div works just fine.


That may not be true in all browsers. In some, the second
div may pop down before it can take focus.


Ah. Good point. I'll check that out.
Jul 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by sdhyok | last post: by
2 posts views Thread by zig | last post: by
10 posts views Thread by Jerzy Karczmarczuk | last post: by
2 posts views Thread by Boobie | last post: by
4 posts views Thread by Ivor Somerset | last post: by
1 post views Thread by Jeremy S. | last post: by
6 posts views Thread by Ioannis Papadopoulos | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.