Dragging & moving DIVs

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Igor Stroh

    #1

    Dragging & moving DIVs

    Hi there,

    I'm trying to implement some kind of a widget toolkit
    which is able to display moveable dialogs. It works
    pretty smooth so far, but there's one problem: when
    a dialog is moved to fast on IE, the mouse pointer
    jumps out of the bounds of the "movement-handle",
    i.e. the title bar of the dialog. I found a thread[1] in c.l.j
    with a great piece of code from Yann-Erwan Perio
    which circumvent the problem of "slow" event handling
    by using setTimeout. Unfortunatelly the code is extensively
    making use of closures, which are extremely hard to read
    and to maintain (at least for me).

    So my question is, could someone have a look at [2]
    and give me a hint of how I could use setTimeout there
    in order to speed up the movement?

    TIA,
    Igor

    [1]: <80376060.04040 81305.787d34cb@ posting.google. com>
    [2]: http://stroh.scan-plus.de/widgets/

    --
    - Do you like WYSIWYG systems?
    - Definitely not. I can type faster than I can point.
    And my mother told me that pointing is impolite.
    (c) Andrew S. Tanenbaum's personal FAQ
  • Tomasz Cenian

    #2
    Re: Dragging &amp; moving DIVs

    Igor Stroh wrote:[color=blue]
    > Hi there,
    >
    > I'm trying to implement some kind of a widget toolkit
    > which is able to display moveable dialogs. It works
    > pretty smooth so far, but there's one problem: when
    > a dialog is moved to fast on IE, the mouse pointer
    > jumps out of the bounds of the "movement-handle",
    > i.e. the title bar of the dialog.[/color]

    For IE, when (drag) try to register onmousemove event for the whole document
    body, not just for the title bar. Detach the event as soon as (!drag).

    Regards

    --
    TC

    Comment

    • Igor Stroh

      #3
      Re: Dragging &amp; moving DIVs

      Tomasz Cenian wrote:
      [color=blue][color=green]
      >>I'm trying to implement some kind of a widget toolkit
      >>which is able to display moveable dialogs. It works
      >>pretty smooth so far, but there's one problem: when
      >>a dialog is moved to fast on IE, the mouse pointer
      >>jumps out of the bounds of the "movement-handle",
      >>i.e. the title bar of the dialog.[/color]
      >
      >
      > For IE, when (drag) try to register onmousemove event for the whole document
      > body, not just for the title bar. Detach the event as soon as (!drag).[/color]

      Thanks, looks like it solved the problem :)

      Cheers,
      Igor

      Comment

      • J. J. Cale

        #4
        Re: Dragging &amp; moving DIVs

        also make sure you use event.cancelBub ble=true; event.returnVal ue=false in
        IE;
        "Igor Stroh" <stroh@scan-plus.de> wrote in message
        news:ch48lu$pbj $1@news.scan-plus.de...[color=blue]
        > Tomasz Cenian wrote:
        >[color=green][color=darkred]
        > >>I'm trying to implement some kind of a widget toolkit
        > >>which is able to display moveable dialogs. It works
        > >>pretty smooth so far, but there's one problem: when
        > >>a dialog is moved to fast on IE, the mouse pointer
        > >>jumps out of the bounds of the "movement-handle",
        > >>i.e. the title bar of the dialog.[/color]
        > >
        > >
        > > For IE, when (drag) try to register onmousemove event for the whole[/color][/color]
        document[color=blue][color=green]
        > > body, not just for the title bar. Detach the event as soon as (!drag).[/color]
        >
        > Thanks, looks like it solved the problem :)
        >
        > Cheers,
        > Igor[/color]


        Comment

        Working...