javascript - jQuery UI droppable not over -
code:
$("div.layout.lo-content > div.content").droppable( { over:function(e,ui) { alert("yes"); $(this).css("background-color","#ffffff"); }, drop: function(e, ui) { $(ui.draggable).appendto($(this)); if($(this).hasclass("ui-sortable")) { $("div.content").sortable('refresh'); } } });
as can see, when element dragged on top of above element, background colour change.
is there way make background colour transparent if element not on droppable container?
such as:
{ notover: function(e,ui) { } }
try
css
div.layout.lo-content > div.content { background-color:transparent; }
js
$("div.layout.lo-content > div.content").droppable( { over:function(e,ui) { alert("yes"); $(this).css("background-color","#ffffff"); }, drop: function(e, ui) { $(ui.draggable).appendto($(this)); if($(this).hasclass("ui-sortable")) { $("div.content").sortable('refresh'); } }, out:function() { $(this).css("background-color","transparent"); } });
Comments
Post a Comment