Connecting Tech Pros Worldwide Forums | Help | Site Map

extend behavior to congruent div

Steven Daedelus
Guest
 
Posts: n/a
#1: Jul 23 '05
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

Steven Daedelus
Guest
 
Posts: n/a
#2: Jul 23 '05

re: extend behavior to congruent div


In article <sdaedelus-1E004F.16593527052004@netnews.comcast.net>,
Steven Daedelus <sdaedelus@ira.gov> wrote:
[color=blue]
> 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[/color]

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
Lee
Guest
 
Posts: n/a
#3: Jul 23 '05

re: extend behavior to congruent div


Steven Daedelus said:[color=blue]
>
>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?[/color]

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().

Steven Daedelus
Guest
 
Posts: n/a
#4: Jul 23 '05

re: extend behavior to congruent div


In article <c95nh902ttp@drn.newsguy.com>,
Lee <REM0VElbspamtrap@cox.net> wrote:
[color=blue]
> Steven Daedelus said:[color=green]
> >
> >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?[/color]
>
> 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().[/color]

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.
Lee
Guest
 
Posts: n/a
#5: Jul 23 '05

re: extend behavior to congruent div


Steven Daedelus said:[color=blue]
>
>In article <c95nh902ttp@drn.newsguy.com>,
> Lee <REM0VElbspamtrap@cox.net> wrote:
>[color=green]
>> Steven Daedelus said:[color=darkred]
>> >
>> >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?[/color]
>>
>> 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().[/color]
>
>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.[/color]

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

Steven Daedelus
Guest
 
Posts: n/a
#6: Jul 23 '05

re: extend behavior to congruent div


In article <c96dq30207l@drn.newsguy.com>,
Lee <REM0VElbspamtrap@cox.net> wrote:
[color=blue]
> Steven Daedelus said:[color=green]
> >
> >In article <c95nh902ttp@drn.newsguy.com>,
> > Lee <REM0VElbspamtrap@cox.net> wrote:
> >[color=darkred]
> >> 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().[/color]
> >
> >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.[/color]
>
> That may not be true in all browsers. In some, the second
> div may pop down before it can take focus.[/color]

Ah. Good point. I'll check that out.
Closed Thread