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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -