HTML drag event does not fire in firefox

后端 未结 3 800
攒了一身酷
攒了一身酷 2021-01-17 20:22

I have a table on which I need to implement draggable header columns. I implemented it using Chrome as my browser, and everything worked fine. When I tested it in Firefox (1

3条回答
  •  梦毁少年i
    2021-01-17 20:43

    The bit that has been cut out http://pastebin.com/bD2g3SqL

    EDIT:

    This does work, however I'm yet to find a way to access the offsetX and offsetY properties, for some reason FF version of the event does not contain them.

    
    
    
    TH Drag Test
    
    
    
    
        
        
    Column A Column B
    One Two
    Three Four

    Apparently, what you need to do is to "initialize" the drag (source.)

    EDIT2:

    Apparently, there's a bug in the drag event (go figure) which does not update the clientX and clientY properties (source.) They are updated on some other events, like the dragover event, however that event will fire only while the object is being dragged over a plausible drop target. A way out of such a silly situation would be something as crude as this:

    
    
    
    TH Drag Test
    
    
    
    
        
        
    Column A Column B
    One Two
    Three Four

提交回复
热议问题