How to enable dblclick event on elements which was binded with JQuery UI Selectable plugin?

后端 未结 6 817
感动是毒
感动是毒 2020-12-19 06:21

In my case,I have an UL with JQuery UI Selectable plugin applied,but at the same time ,I want the item witch was binded with selectable plugin was

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-19 06:34

    This is because onmousedown triggers selection event (the dotted div that selects multiple selectable elements.) I had the same problem and i fixed it by adding a few lines of the code to the JQUERY UI library. What you have to do is to delay selection event by starting it after the mouse moves a few pixels. This allows you to double click element and still have the selection that is user friendly! :D

    This is the part of the code that delays the selection and solves your problem:

    
    

    I found this workaround in this post

提交回复
热议问题