P
P
pashabomber2015-09-28 09:29:41
css
pashabomber, 2015-09-28 09:29:41

How to change the background of the block where files are dragged to be uploaded on hover?

Good afternoon!

The site is designed to upload files by dragging them into the block. bnews2.volodin-web.ru/reporter-popup.html
I need to make it change the background color when the mouse with the file is hovered anywhere in its area. :hover does not work if you drag a file there with the mouse.

Tell me, please, how to solve this problem?

Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
The whiz, 2015-09-28
@modernstyle

See how it's done here: jqueryui.com/droppable/#visual-feedback

$( "#draggable" ).draggable();
$( "#droppable" ).droppable({
    hoverClass: "ui-state-active",
    drop: function( event, ui ) {
        $( this )
            .addClass( "ui-state-highlight" )
            .find( "p" )
                .html( "Dropped!" );
    }
});
$( "#draggable2" ).draggable();
$( "#droppable2" ).droppable({
    accept: "#draggable2",
    activeClass: "ui-state-hover",
    drop: function( event, ui ) {
        $( this )
            .addClass( "ui-state-highlight" )
            .find( "p" )
                .html( "Dropped!" );
    }
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question