Take the 2-minute tour ×

I'm having a problem with ondragover in Firefox and I can't seem to find a solution.

I've set a simple example on http://jsfiddle.net/treerock/mtnz5/ that seems to replicate the problem.

box.ondragover = function() {
    console.log("Drag Over");
    return false;

I'm expecting that if I dragged an image file (or any data in this simplified example) over the box the ondragover event fires and 'stuff happens'. This seems to work as expected in Chrome. But in Firefox the function is only executed after I release the mouse button or drag the image back out of the browser.

Thanks for your help


On closer look at the console, it seems the event is firing, it's just the css that isn't updating until after I release the button. And it doesn't seem to be a browser thing, happening in both Chrome and Firefox. Sorry, should have looked closer.

[Another Update]

Okay, I've updated the jsfiddle. This time using ondragenter to add a class to the box div. Works fine when I drag a link or text over, but still not working immediately when I drag a file.

share|improve this question
Your fiddle didn't work for me a few minutes ago, but now fires the Dragover repeatedly while the file's over it (FF22.0) –  A.M. D. Nov 18 '13 at 11:42
Following your update the OP, your CSS hover state is working for me in FF22 while dragging. Hope this helps. –  A.M. D. Nov 18 '13 at 11:50
Yeah sorry, I should have taken more time checking my example. The dragover is firing, but I'm still looking at why the page isn't updating immediately. That's got me closer to the solution so thanks. –  Bruce Hadden Nov 18 '13 at 11:54
add comment

Your Answer



Browse other questions tagged or ask your own question.