Skip to content

Instantly share code, notes, and snippets.

@ryan5500
Created April 20, 2010 19:36
Show Gist options
  • Select an option

  • Save ryan5500/372950 to your computer and use it in GitHub Desktop.

Select an option

Save ryan5500/372950 to your computer and use it in GitHub Desktop.
jquery-ui droppable bug
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-ui.js"></script>
<script type="text/javascript" src="drop_test.js"></script>
<style>
#ans_container {
width: 400px;
height: 400px;
border: 1px solid gray;
background-color: #CDFFFF;
overflow: hidden;
}
#container {
width: 300px;
height: 200px;
border: 1px solid gray;
background-color: #0093FF;
}
#draggable {
width:100px;
height:100px;
background-color: #D9FF57;
}
</style>
</head>
<body>
<div id="ans_container">
<div id="container">
</div>
</div>
<div id="draggable">
</div>
</body>
</html>
$(function() {
$('#draggable').draggable();
$('#ans_container').droppable({
drop:function() {
//always called here
alert('ans container');
}
});
$('#container').droppable({
drop:function() {
//never called
alert('container');
}
});
});
$(function() {
$('#draggable').draggable();
$('#container').droppable({
drop:function() {
alert('container');
}
});
$('#ans_container').droppable({
drop:function() {
alert('ans container');
}
});
});
@ryan5500
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment