Prevent cursor from leaving div in designMode (Mozilla)

M

mldebondt

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!
 
L

Lich_Ray

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.
 
M

mldebondt

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top