HTML5 drag & drop behaviour

前端 未结 3 1341
终归单人心
终归单人心 2021-02-13 15:12

I\'m making extensive use of the HTML5 native drag & drop, and it\'s almost entirely behaving itself, with one small exception.

I\'m trying to highlight my dropzones

3条回答
  •  臣服心动
    2021-02-13 16:10

    I tried the accepted solution here, but ended up using setTimeout to overcome the issue. I was having a ton of trouble with the page-wide container blocking the drop element if it was floated on top, and still causing the problem if it was the drop element.

    
        
     
     
    other element
     - 
    another element














    If you were to just call f(); instead of window.setTimeout(f, 250);, you'll see some nasty flickering of the element showing and hiding.

    http://jsfiddle.net/guYWx/

提交回复
热议问题