1

I want not to highlight element when I drag some of my element, and for this purpose I did this

$('#object')
 .draggable()
 .mousedown(function(event) {
   event.preventDefault();
 });

but now I encounter a problem that my other element's event such as blur didn't invoke. for instance when the focus enter in the element and this element has blur event, when I chose my draggable element, the blur event of previous element didn't invoke.

How can I handle this. also I didn't know which element focusout that I invoke blur event in mousedown event.

AKZ
  • 856
  • 2
  • 12
  • 30
  • 2
    try CSS... [http://stackoverflow.com/questions/826782/css-rule-to-disable-text-selection-highlighting](http://stackoverflow.com/questions/826782/css-rule-to-disable-text-selection-highlighting) `user-select: none;` – Pimp Trizkit Oct 31 '12 at 10:40
  • what happanes when you first assign `mosuedown` and after that make your obkect `dragabble`? – Reflective Oct 31 '12 at 10:43
  • Thanks for help I think I must handle this with css rules – AKZ Oct 31 '12 at 10:49

1 Answers1

4

Try:

$('#object').css('user-select','none').prop('unselectable','on').on('selectstart',false);
Elliott
  • 2,669
  • 2
  • 23
  • 33