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 | | | | 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 | | | | 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(). | | | | 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. | | | | 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. | | | | 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. |  | Similar JavaScript / Ajax / DHTML bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,510 network members.
|