Prevent cursor from leaving div in designMode (Mozilla)

Discussion in 'Javascript' started by mldebondt, Nov 8, 2006.

  1. mldebondt

    mldebondt Guest

    Hi,

    I'm rewriting a cms for Mozilla and it uses designMode. My problem is
    that the cursor can leave the editing div-element so the functions
    don't work correctly.

    How can I prevent the cursor from leaving this html-element?

    Thanks in advance!
    mldebondt, Nov 8, 2006
    #1
    1. Advertising

  2. mldebondt

    Lich_Ray Guest

    Use the element's onfocus() method to test whether the cursor is in you
    div, than combine a function to the element, use it to reset the
    cursor's place.
    Lich_Ray, Nov 8, 2006
    #2
    1. Advertising

  3. mldebondt

    mldebondt Guest

    How can I add an eventlistener to the div?

    var div1 = document.getElementById("div1");
    div1.addEventListener("blur", div1.focus(), false); // 1
    div1.onblur=div1.focus(); // 2

    Both methods don't seem to work... This is what you meant, right?

    Lich_Ray wrote:
    > Use the element's onfocus() method to test whether the cursor is in you
    > div, than combine a function to the element, use it to reset the
    > cursor's place.
    mldebondt, Nov 8, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VG9tYXMgS2VwaWM=?=

    Changing DEFAULT cursor to WAIT cursor in ASP

    =?Utf-8?B?VG9tYXMgS2VwaWM=?=, Apr 5, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,317
    Bruce Barker
    Apr 5, 2005
  2. Matthew
    Replies:
    0
    Views:
    411
    Matthew
    Jan 15, 2004
  3. dmaziuk
    Replies:
    3
    Views:
    577
    Chris Gonnerman
    Jan 25, 2011
  4. Matthew
    Replies:
    0
    Views:
    103
    Matthew
    Jan 15, 2004
  5. Joop
    Replies:
    0
    Views:
    97
Loading...

Share This Page