extend behavior to congruent div

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steven Daedelus

    #1

    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
  • Steven Daedelus

    #2
    Re: extend behavior to congruent div

    In article <sdaedelus-1E004F.16593527 052004@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

    Comment

    • Lee

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

      Comment

      • Steven Daedelus

        #4
        Re: extend behavior to congruent div

        In article <c95nh902ttp@dr n.newsguy.com>,
        Lee <REM0VElbspamtr ap@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.

        Comment

        • Lee

          #5
          Re: extend behavior to congruent div

          Steven Daedelus said:[color=blue]
          >
          >In article <c95nh902ttp@dr n.newsguy.com>,
          > Lee <REM0VElbspamtr ap@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.

          Comment

          • Steven Daedelus

            #6
            Re: extend behavior to congruent div

            In article <c96dq30207l@dr n.newsguy.com>,
            Lee <REM0VElbspamtr ap@cox.net> wrote:
            [color=blue]
            > Steven Daedelus said:[color=green]
            > >
            > >In article <c95nh902ttp@dr n.newsguy.com>,
            > > Lee <REM0VElbspamtr ap@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.

            Comment

            Working...